Set pointer to NULL after free
This commit is contained in:
parent
87921cb740
commit
a2fe24937b
1 changed files with 6 additions and 2 deletions
|
|
@ -179,10 +179,14 @@ add_snmp_var_bindings(netsnmp_variable_list **var_list,
|
|||
clixon_debug(CLIXON_DBG_SNMP, "type %s not supported in snmp trap", yang_key2str(yang_keyword_get(ychild)));
|
||||
break;
|
||||
}
|
||||
if (xmlstr)
|
||||
if (xmlstr) {
|
||||
free(xmlstr);
|
||||
if (snmpval)
|
||||
xmlstr = NULL;
|
||||
}
|
||||
if (snmpval) {
|
||||
free(snmpval);
|
||||
snmpval = NULL;
|
||||
}
|
||||
} else {
|
||||
clixon_debug(CLIXON_DBG_SNMP, "no yang def found for %s", node_name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue