[PATCH] monitor: Fix possible resource leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

This fixes following memory leak:
...
==14887== 24 bytes in 1 blocks are definitely lost in loss record 2 of 4
==14887==    at 0x4C2CC70: calloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14887==    by 0x425B6C: btsnoop_open (btsnoop.c:83)
==14887==    by 0x424837: analyze_trace (analyze.c:262)
==14887==    by 0x40249A: main (main.c:189)
...
---
 monitor/analyze.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/monitor/analyze.c b/monitor/analyze.c
index a5ed5f4..5288cf3 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
@@ -272,7 +272,7 @@ void analyze_trace(const char *path)
 		break;
 	default:
 		fprintf(stderr, "Unsupported packet format\n");
-		return;
+		goto done;
 	}
 
 	dev_list = queue_new();
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux