X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsnmp.c;h=b90e0ffa69269f4ad67df7874423989521d7cb60;hb=9d6f72e5054cfbb183585991fefcf119259d71c4;hp=38a24cd3b29c18ac632af562a61ce62d6cca48d6;hpb=32e0d9078b73eeb889b9a1e62be72ded48d33d7d;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 38a24cd3..b90e0ffa 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -108,7 +108,7 @@ static int csnmp_read_host (user_data_t *ud); */ static void csnmp_oid_init (oid_t *dst, oid const *src, size_t n) { - assert (n <= STATIC_ARRAY_LEN (dst->oid)); + assert (n <= STATIC_ARRAY_SIZE (dst->oid)); memcpy (dst->oid, src, sizeof (*src) * n); dst->oid_len = n; } @@ -1373,12 +1373,12 @@ 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 */ - int ret; ret = csnmp_oid_suffix (&suffix, &vb_name, data->values + i); if (ret != 0) { @@ -1437,6 +1437,11 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) snmp_free_pdu (res); res = NULL; + /* + * memory is handled by snmp_synch_response + */ + req = NULL; + if (status == 0) csnmp_dispatch_table (host, data, instance_list_head, value_list_head); @@ -1590,7 +1595,7 @@ static int csnmp_read_host (user_data_t *ud) host = ud->data; if (host->interval == 0) - host->interval = interval_g; + host->interval = plugin_get_interval (); time_start = cdtime ();