From: hno <> Date: Mon, 28 May 2001 05:24:44 +0000 (+0000) Subject: Bugzilla #162 X-Git-Tag: SQUID_3_0_PRE1~1504 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ccbae85f39359482c96c5d1c402cc99050b3c2a;p=thirdparty%2Fsquid.git Bugzilla #162 snmpAddNode() duplicates the oid created by snmpCreateOid() and does not free the original. A few bytes leaked at start-up. Reported & patched by Rady Greab --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 48d2fcafc4..3e17f4cc33 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.48 2001/05/16 07:47:00 hno Exp $ + * $Id: snmp_core.cc,v 1.49 2001/05/27 23:24:44 hno Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -97,9 +97,6 @@ snmpInit(void) snmplib_debug_hook = snmpSnmplibDebug; - /* XXX: This leaks memory due to snmpAddNode duplicating the passed - * oid node, and we are not freeing the one returned by snmpCreateOid - */ mib_tree_head = snmpAddNode(snmpCreateOid(1, 1), 1, NULL, NULL, 1, snmpAddNode(snmpCreateOid(2, 1, 3), @@ -959,7 +956,7 @@ snmpAddNode(va_alist) va_start(args, children); entry = xmalloc(sizeof(mib_tree_entry)); - entry->name = snmpOidDup(name, len); + entry->name = name; entry->len = len; entry->parsefunction = parsefunction; entry->instancefunction = instancefunction;