logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

SNMP_FREE() or free() ??: msg#00067

Subject: SNMP_FREE() or free() ??
hi

i am actually working on the removing of all the memory leaks which are
in the currently version of net-snmp.
because since i installed my netfilter snmp-module the daemon constantly
increases its memory.

i wrote/write cleanup functions for each *used* data-structures, which
should be called on shutdown, so *all* memory will be freed on shutdown
by the daemon itself. (i know this does the system itself, but it is
cleaner, and new memory leaks are faster to find)

during this work i found that in the code is used free() and SNMP_FREE
as a macro which will free() only if the pointer is not NULL and set to
NULL after the free().

is there another special (logical) sense behind SNMP_FREE, or is it
legal to use SNMP_FREE instead of free() at all?
i ask because i am actually replacing all occurrences of free().

peter




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en


<Prev in Thread] Current Thread [Next in Thread>