
On Thu, Jul 28, 2016 at 01:29:41PM +0000, Bijal Thanawala wrote:
Hi libsmi team, This is to report two issues with regards to : libsmi-0.4.8-16.fc23.x86_64
Issue #1Although smiExit() does good job of freeing memory blocks allocated by smiInit, it misses one. To be precise, 44 out of 45 allocated memory block are freed. (Details of the experiment at the end of this mail)
I see 80 bytes not freed on my Debian system but this does not make me really concerned; that said I am happy to accept a patch if someone manages to track this down.
Issue #2The libsmi examples here^ do not call smiExit():^ https://www.ibr.cs.tu-bs.de/projects/libsmi/example.html%5E https://www.ibr.cs.tu-bs.de/projects/libsmi/libsmi.html
Yes, the example would be nicer if it would show how to call smiExit() but then a decent OS will cleanup anyway when the process exits. I can't easily change the example since I have no direct way to access the web page anymore.
Details of the memory leak:To investigate this issue, first noted by 'tcpdump' project, I wrote two simple programs; one calls smiExit(), and the other does not.(Platform: Fedora Core 23 (64 bit))
[...]
I have just begun to contribute to tcpdump project, and have no experience of using libsmi,but glad to participate in discussion with regards to this.
I do not think the ~80 bytes lost really affect tcpdump; libsmi initially did not really care about freeing anything since most applications load MIB data and then they use it until completion (and I think tcpdump falls into this category). We started being more concerned about freeing memory when we added the ability to maintain multiple MIB trees and applications wanted to load and unload MIB trees dynamically.
/js