X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsnmp.c;h=3e6cb9119cb7a8a40a24f330f2398b00e3b1d104;hb=96e0f2341bace029acefe0a88bab96ae326c0ff5;hp=4f849320a3f3f6bdc2bdfb3730bf60fdc08016c5;hpb=38e2d0eff79464e4b9686e135a184411d9307db7;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 4f849320..3e6cb911 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1373,13 +1373,14 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) csnmp_table_values_t *vt; oid_t vb_name; oid_t suffix; + int ret; csnmp_oid_init (&vb_name, vb->name, vb->name_length); /* Calculate the current suffix. This is later used to check that the * suffix is increasing. This also checks if we left the subtree */ - status = csnmp_oid_suffix (&suffix, &vb_name, data->values + i); - if (status != 0) + ret = csnmp_oid_suffix (&suffix, &vb_name, data->values + i); + if (ret != 0) { DEBUG ("snmp plugin: host = %s; data = %s; i = %i; " "Value probably left its subtree.", @@ -1436,6 +1437,10 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) snmp_free_pdu (res); res = NULL; + if (req != NULL) + snmp_free_pdu (req); + req = NULL; + if (status == 0) csnmp_dispatch_table (host, data, instance_list_head, value_list_head);