Page MenuHomeFreeBSD

D55998.id174032.diff
No OneTemporary

D55998.id174032.diff

diff --git a/contrib/bsnmp/snmp_mibII/mibII.c b/contrib/bsnmp/snmp_mibII/mibII.c
--- a/contrib/bsnmp/snmp_mibII/mibII.c
+++ b/contrib/bsnmp/snmp_mibII/mibII.c
@@ -485,6 +485,7 @@
syslog(LOG_WARNING, "sysctl linkmib estimate (%s): %m",
ifp->name);
if (ifp->specmib != NULL) {
+ free(ifp->specmib);
ifp->specmib = NULL;
ifp->specmiblen = 0;
}
@@ -492,6 +493,7 @@
}
if (len == 0) {
if (ifp->specmib != NULL) {
+ free(ifp->specmib);
ifp->specmib = NULL;
ifp->specmiblen = 0;
}
@@ -500,6 +502,7 @@
if (ifp->specmiblen != len) {
if ((newmib = realloc(ifp->specmib, len)) == NULL) {
+ free(ifp->specmib);
ifp->specmib = NULL;
ifp->specmiblen = 0;
goto out;
@@ -510,6 +513,7 @@
if (sysctl(name, nitems(name), ifp->specmib, &len, NULL, 0) == -1) {
syslog(LOG_WARNING, "sysctl linkmib (%s): %m", ifp->name);
if (ifp->specmib != NULL) {
+ free(ifp->specmib);
ifp->specmib = NULL;
ifp->specmiblen = 0;
}
@@ -546,9 +550,11 @@
alias_maxlen = MIBIF_ALIAS_SIZE_MAX;
/*
+ * Free any alias memory allocated by a previous call.
* Allocate maximum memory for a buffer and later reallocate
* to free extra memory.
*/
+ free(ifp->alias);
if ((ifp->alias = malloc(alias_maxlen)) == NULL) {
syslog(LOG_WARNING, "malloc(%d) failed: %m", (int)alias_maxlen);
goto fin;

File Metadata

Mime Type
text/plain
Expires
Tue, May 26, 11:40 PM (10 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30086602
Default Alt Text
D55998.id174032.diff (1 KB)

Event Timeline