The result was not freed when `csnmp_instance_list_add' failed. This
rarely happens in 4.3, but later versions will be more strict in the
function, so this became a problem.
vb = res->variables;
if (vb == NULL)
{
- if (res != NULL)
- snmp_free_pdu (res);
- res = NULL;
-
status = -1;
break;
}
* subtree */
if (csnmp_check_res_left_subtree (host, data, res) != 0)
{
- if (res != NULL)
- snmp_free_pdu (res);
- res = NULL;
-
+ status = 0;
break;
}
(vb != NULL) && (vb->next_variable != NULL);
vb = vb->next_variable)
/* do nothing */;
- if (vb == NULL)
- {
- status = -1;
- break;
- }
+ assert (vb != NULL);
/* Copy OID to oid_list[data->values_len] */
memcpy (oid_list[data->values_len].oid, vb->name,
res = NULL;
} /* while (status == 0) */
+ if (res != NULL)
+ snmp_free_pdu (res);
+ res = NULL;
+
if (status == 0)
csnmp_dispatch_table (host, data, instance_list, value_table);