From: Henrik Nordstrom Date: Tue, 15 Jun 2010 22:52:16 +0000 (+0200) Subject: free memory corruption introduced by the polishing of the SNMP tree generator. X-Git-Tag: SQUID_3_2_0_1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0071c96f6730b1801471948964df23385da9bc5;p=thirdparty%2Fsquid.git free memory corruption introduced by the polishing of the SNMP tree generator. --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 8e6adaf494..63821ded41 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -963,9 +963,10 @@ snmpCreateOidFromStr(const char *str, oid **name, int *nl) *name = NULL; *nl = 0; char *s = xstrdup(str); + char *s_ = s; /* Parse the OID string into oid bits */ - while ( (p = strsep(&s, delim)) != NULL) { + while ( (p = strsep(&s_, delim)) != NULL) { *name = (oid*)xrealloc(*name, sizeof(oid) * ((*nl) + 1)); (*name)[*nl] = atoi(p); (*nl)++;