Skip to contentSkip to conversation

genl: Fix memory leak

PATCH In review Ravi kumar Veeramally 2 participants 2 messages Dec 15, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 genl: Fix memory leak

==7322== Command: unit/test-genl
==7322==
==7322==
==7322== HEAP SUMMARY:
==7322== in use at exit: 192 bytes in 5 blocks
==7322== total heap usage: 17 allocs, 12 frees, 1,672 bytes allocated
==7322==
==7322== 192 (104 direct, 88 indirect) bytes in 1 blocks are definitely lost in loss record 5 of 5

==7322==    at 0x4C2ABA0: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7322==    by 0x403D1D: l_malloc (util.c:62)
==7322==    by 0x402653: family_alloc (genl.c:144)
==7322==    by 0x4029FA: l_genl_new (genl.c:506)
==7322==    by 0x402BEF: l_genl_new_default (genl.c:548)
==7322==    by 0x400FDA: main (test-genl.c:49)

==7322==
==7322== LEAK SUMMARY:
==7322== definitely lost: 104 bytes in 1 blocks
==7322== indirectly lost: 88 bytes in 4 blocks
==7322== possibly lost: 0 bytes in 0 blocks
==7322== still reachable: 0 bytes in 0 blocks
==7322== suppressed: 0 bytes in 0 blocks

---
 ell/genl.c | 2 ++
 1 file changed, 2 insertions(+)
ell/genl.c +2 -0
index 88f73bc..dca8e1b 100644
@@ -593,6 +593,8 @@ void l_genl_unref(struct l_genl *genl)
 	l_io_destroy(genl->io);
 	genl->io = NULL;
 
+	l_genl_family_unref(genl->nlctrl);
+
 	l_queue_destroy(genl->family_list, family_free);
 
 	if (genl->close_on_unref)
Signature · 1 line
2.1.0
#1 lore raw

Hi Ravi,

Quoted 3 lines
  ell/genl.c | 2 ++
  1 file changed, 2 insertions(+)

Patch has been applied, thanks.

Regards,
-Denis