Fix memory leak

This commit is contained in:
Mico Micic 2024-07-29 07:51:25 +02:00 committed by Olof Hagsand
parent 8ee9b82152
commit 1a248b75e5

View file

@ -179,6 +179,10 @@ 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))); clixon_debug(CLIXON_DBG_SNMP, "type %s not supported in snmp trap", yang_key2str(yang_keyword_get(ychild)));
break; break;
} }
if (xmlstr)
free(xmlstr);
if (snmpval)
free(snmpval);
} else { } else {
clixon_debug(CLIXON_DBG_SNMP, "no yang def found for %s", node_name); clixon_debug(CLIXON_DBG_SNMP, "no yang def found for %s", node_name);
} }