]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #162
authorhno <>
Mon, 28 May 2001 05:24:44 +0000 (05:24 +0000)
committerhno <>
Mon, 28 May 2001 05:24:44 +0000 (05:24 +0000)
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

src/snmp_core.cc

index 48d2fcafc405ff32d8f996b381eb9335c2d9ee56..3e17f4cc333c3c3b297e83ada5033920de488ac6 100644 (file)
@@ -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;