projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-4.4'
[collectd.git]
/
src
/
snmp.c
diff --git
a/src/snmp.c
b/src/snmp.c
index
2026e8b
..
0dad67c
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-1153,10
+1153,6
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
vb = res->variables;
if (vb == NULL)
{
vb = res->variables;
if (vb == NULL)
{
- if (res != NULL)
- snmp_free_pdu (res);
- res = NULL;
-
status = -1;
break;
}
status = -1;
break;
}
@@
-1165,10
+1161,7
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
* subtree */
if (csnmp_check_res_left_subtree (host, data, res) != 0)
{
* subtree */
if (csnmp_check_res_left_subtree (host, data, res) != 0)
{
- if (res != NULL)
- snmp_free_pdu (res);
- res = NULL;
-
+ status = 0;
break;
}
break;
}
@@
-1190,11
+1183,7
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
(vb != NULL) && (vb->next_variable != NULL);
vb = vb->next_variable)
/* do nothing */;
(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,
/* Copy OID to oid_list[data->values_len] */
memcpy (oid_list[data->values_len].oid, vb->name,
@@
-1257,6
+1246,10
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
res = NULL;
} /* while (status == 0) */
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);
if (status == 0)
csnmp_dispatch_table (host, data, instance_list, value_table);