Re: [PATCH] android/tester: Fix memory leak

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

 



Hi Andrei,

On Fri, Dec 20, 2013, Andrei Emeltchenko wrote:
> Call del_hook() after add_hook(). This fixes valgrind warnings:
> 
> ...
> ==15303==
> ==15303== HEAP SUMMARY:
> ==15303==     in use at exit: 3,060 bytes in 27 blocks
> ==15303==   total heap usage: 6,410 allocs, 6,383 frees, 332,477 bytes
> allocated
> ==15303==
> ==15303== 24 bytes in 1 blocks are definitely lost in loss record 9 of
> 27
> ==15303==    at 0x4C2A2DB: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
> ==15303==    by 0x40BFC2: test_discovery_start_done
> (android-tester.c:1401)
> ==15303==    by 0x409C65: run_callback (tester.c:385)
> ==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x4E7C707: ??? (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x4E7CB09: g_main_loop_run (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x40A85C: tester_run (tester.c:784)
> ==15303==    by 0x40368B: main (android-tester.c:1654)
> ==15303==
> ==15303== 24 bytes in 1 blocks are definitely lost in loss record 10 of
> 27
> ==15303==    at 0x4C2A2DB: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==15303==    by 0x406E20: btdev_add_hook (btdev.c:2166)
> ==15303==    by 0x40BF12: test_discovery_stop_success
> (android-tester.c:1386)
> ==15303==    by 0x409C65: run_callback (tester.c:385)
> ==15303==    by 0x4E7C3B5: g_main_context_dispatch (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x4E7C707: ??? (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x4E7CB09: g_main_loop_run (in
> /lib/x86_64-linux-gnu/libglib-2.0.so.0.3800.1)
> ==15303==    by 0x40A85C: tester_run (tester.c:784)
> ==15303==    by 0x40368B: main (android-tester.c:1654)
> ==15303==
> ...
> ---
>  android/android-tester.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

Applied. Thanks.

Johan
--
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