OSDN Git Service

shared: Fix memory leaks in mgmt_unref
authorSzymon Janc <szymon.janc@tieto.com>
Thu, 9 Jan 2014 14:17:10 +0000 (15:17 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 9 Jan 2014 14:31:34 +0000 (16:31 +0200)
commitf8754ec28b47ccf9e044ef0a20df47f7e1df78a3
treee6472f18d007855c297180543b633c0da8adddf7
parent51e9b93d604e88a1e09ea5e20467c1fa10d5f6aa
shared: Fix memory leaks in mgmt_unref

Destroy notify and pending lists on freeing mgmt. Those two lists
cannot be destroyed in same place as reply and request queues due
to being used in can_read_data().

Fix following valgrind reports:

24 bytes in 1 blocks are definitely lost in loss record 70 of 212
   at 0x4C2C494: calloc (in /usr/lib/valgrind/
       vgpreload_memcheck-amd64-linux.so)
   by 0x46B5E2: queue_new (queue.c:46)
   by 0x46C3CA: mgmt_new (mgmt.c:407)
   by 0x46C4B5: mgmt_new_default (mgmt.c:466)
   by 0x45FB45: adapter_init (adapter.c:6237)
   by 0x40A4F1: main (main.c:534)

24 bytes in 1 blocks are definitely lost in loss record 71 of 212
   at 0x4C2C494: calloc (in /usr/lib/
       valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x46B5E2: queue_new (queue.c:46)
   by 0x46C3D8: mgmt_new (mgmt.c:417)
   by 0x46C4B5: mgmt_new_default (mgmt.c:466)
   by 0x45FB45: adapter_init (adapter.c:6237)
   by 0x40A4F1: main (main.c:534)
src/shared/mgmt.c