Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement:
Mentioning few of the leaks here:
=3843268== 6 bytes in 3 blocks are still reachable in loss record 1 of 29
==3843268== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3843268== by 0x489ED0E: qmalloc (memory.c:106)
==3843268== by 0x48DE8DB: redist_add_instance (zclient.c:125)
==3843268== by 0x48DF561: zclient_init (zclient.c:647)
==3843268== by 0x14FFA3: pim_zebra_init (pim_zebra.c:527)
==3843268== by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 2 of 29
==3843268== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268== by 0x489EE03: qcalloc (memory.c:111)
==3843268== by 0x4878DDE: buffer_new (buffer.c:72)
==3843268== by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268== by 0x14FF1D: pim_zebra_init (pim_zebra.c:516)
==3843268== by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 3 of 29
==3843268== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268== by 0x489EE03: qcalloc (memory.c:111)
==3843268== by 0x4878DDE: buffer_new (buffer.c:72)
==3843268== by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268== by 0x150A3D: zclient_lookup_new (pim_zlookup.c:131)
==3843268== by 0x11D021: main (pim6_main.c:178)
RCA:
Memory is allocated when the daemon started but
it is not freed when terminated.
Fix:
Freeing the memory when daemon goes down.