net-snmp / net-snmp

A SNMP application library, tools and daemon

Repository from Github https://github.comnet-snmp/net-snmpRepository from Github https://github.comnet-snmp/net-snmp

Possible memory leak

VoroninArtemii opened this issue · comments

There is a possible memory leak. We allocated memory in the line №1205 inside function netsnmp_table_row_add_inde and it leaked in the line №1197.

for (vb = tables->table_set->table->indexes_template; vb;
vb = vb->next_variable) {
if (!line) {
config_pwarn("missing an index value");
SNMP_FREE (row);
return;
}
DEBUGMSGTL(("table_set_add_row", "adding index of type %d\n",
vb->type));
buf_size = sizeof(buf);
line = read_config_read_memory(vb->type, line, buf, &buf_size);
netsnmp_table_row_add_index(row, vb->type, buf, buf_size);
}

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Voronin