projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial support of GPSd in collectd.
[collectd.git]
/
src
/
snmp.c
diff --git
a/src/snmp.c
b/src/snmp.c
index
260eff1
..
cb0b70f
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-1235,16
+1235,17
@@
static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat
return (-1);
}
assert (ds->ds_num == data->values_len);
return (-1);
}
assert (ds->ds_num == data->values_len);
+ assert (data->values_len > 0);
instance_list_ptr = instance_list;
instance_list_ptr = instance_list;
- value_table_ptr =
malloc (sizeof (*value_table_ptr) * data->values_len
);
+ value_table_ptr =
calloc ((size_t) data->values_len, sizeof (*value_table_ptr)
);
if (value_table_ptr == NULL)
return (-1);
for (i = 0; i < data->values_len; i++)
value_table_ptr[i] = value_table[i];
if (value_table_ptr == NULL)
return (-1);
for (i = 0; i < data->values_len; i++)
value_table_ptr[i] = value_table[i];
- vl.values_len = d
s->ds_num
;
+ vl.values_len = d
ata->values_len
;
vl.values = malloc (sizeof (*vl.values) * vl.values_len);
if (vl.values == NULL)
{
vl.values = malloc (sizeof (*vl.values) * vl.values_len);
if (vl.values == NULL)
{
@@
-1670,7
+1671,7
@@
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
if (host->sess_handle == NULL)
{
if (host->sess_handle == NULL)
{
- DEBUG ("snmp plugin: csnmp_read_
tabl
e: host->sess_handle == NULL");
+ DEBUG ("snmp plugin: csnmp_read_
valu
e: host->sess_handle == NULL");
return (-1);
}
return (-1);
}