linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] monitor: Fix possible resource leak
@ 2014-07-04 12:45 Andrei Emeltchenko
  2014-07-04 13:21 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Andrei Emeltchenko @ 2014-07-04 12:45 UTC (permalink / raw)
  To: linux-bluetooth

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] monitor: Fix possible resource leak
  2014-07-04 12:45 [PATCH] monitor: Fix possible resource leak Andrei Emeltchenko
@ 2014-07-04 13:21 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2014-07-04 13:21 UTC (permalink / raw)
  To: Andrei Emeltchenko; +Cc: linux-bluetooth

Hi Andrei,

On Fri, Jul 04, 2014, Andrei Emeltchenko wrote:
> 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(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-04 13:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-04 12:45 [PATCH] monitor: Fix possible resource leak Andrei Emeltchenko
2014-07-04 13:21 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).