
On Mon, Feb 28, 2011 at 10:29:39AM +0000, Fort, Andrew wrote:
I have detected a couple of memory leaks (using Visual Leak Detector) in a project where I parse a MIB with 4 imported MIBs.
One (44 bytes) seems to be associated with 'parser.pendingNodePtr' allocated in smiInitData. (adding smiFree(parser.pendingNodePtr); at the end of the function removes this leak).
The 2nd leak (36 bytes) originates in smiLoadModule used to handle the MIB parsing. The call stack returned was: Call Stack: c:\projects\hf sdr\msvc\smi-0.4.8<stdout> (14160): smirealloc c:\projects\hf sdr\msvc\smi-0.4.8<stdout> (13871): smiensure_buffer_stack c:\projects\hf sdr\msvc\smi-0.4.8<stdout> (13647): smi_switch_to_buffer c:\projects\hf sdr\msvc\smi-0.4.8\scanner-smi.l (82): smiEnterLexRecursion c:\projects\hf sdr\smi-0.4.8\lib\data.c (4733): loadModule c:\projects\hf sdr\msvc\smi-0.4.8\parser-smi.y (1755): smiparse c:\projects\hf sdr\smi-0.4.8\lib\data.c (4740): loadModule
Any insights welcome.
I do not care that much about those 36 bytes and 44 bytes lost - this might just be some initialization overhead. If you have a patch, I am of course interested.
/js