Hello! I would like to know who it is that actually owns objects that are passed around.
Specific examples: snmp_sess_add_ex(netsnmp_session* sess, netsnmp_transport* trans, ...) Looking on this one you find that it never frees transport, except when the session version is SNMP_VERSION_3, in that case the transport is freed if the security initialization fails, but not on other errors. This of course makes all the _add_ functions a lot less useful for SNMPv3 sessions (everything else is ok). The implication of this is that the connection acceptance code in _sess_read is a bug waiting to happen, the only thing that have saved us this long is the low popularity of SNMP over TCP :-) snmp_register_callback(int, int, new_callback, void* arg) The arg parameter is freed when clear_callback is called but not under any other circumstances. Who owns that pointer? The implication of this one is the infamous *** glibc detected *** double free or corruption (!prev): 0x0810d398 *** that comes when we try to free the session pointer that was registered in agentx_register_callbacks. This naturally fails since subagent_shutdown already have freed that pointer. One way around this would of course be to call netsnmp_callback_clear_client_arg from subagent_shutdown but that still leaves the question of ownership unresolved. /MF ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
