projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
curl_json plugin: fix indentation
[collectd.git]
/
src
/
snmp.c
diff --git
a/src/snmp.c
b/src/snmp.c
index
0e2af3b
..
6a5bb8b
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-29,8
+29,6
@@
#include "plugin.h"
#include "utils_complain.h"
#include "plugin.h"
#include "utils_complain.h"
-#include <pthread.h>
-
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
@@
-520,7
+518,7
@@
static int csnmp_config_add_host_collect (host_definition_t *host,
}
data_list_len = host->data_list_len + ci->values_num;
}
data_list_len = host->data_list_len + ci->values_num;
- data_list =
(data_definition_t **)
realloc (host->data_list,
+ data_list = realloc (host->data_list,
sizeof (data_definition_t *) * data_list_len);
if (data_list == NULL)
return (-1);
sizeof (data_definition_t *) * data_list_len);
if (data_list == NULL)
return (-1);
@@
-1673,7
+1671,7
@@
static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
{
struct snmp_pdu *req;
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
{
struct snmp_pdu *req;
- struct snmp_pdu *res;
+ struct snmp_pdu *res
= NULL
;
struct variable_list *vb;
const data_set_t *ds;
struct variable_list *vb;
const data_set_t *ds;
@@
-1735,7
+1733,6
@@
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
for (i = 0; i < data->values_len; i++)
snmp_add_null_var (req, data->values[i].oid, data->values[i].oid_len);
for (i = 0; i < data->values_len; i++)
snmp_add_null_var (req, data->values[i].oid, data->values[i].oid_len);
- res = NULL;
status = snmp_sess_synch_response (host->sess_handle, req, &res);
if ((status != STAT_SUCCESS) || (res == NULL))
status = snmp_sess_synch_response (host->sess_handle, req, &res);
if ((status != STAT_SUCCESS) || (res == NULL))
@@
-1748,7
+1745,6
@@
static int csnmp_read_value (host_definition_t *host, data_definition_t *data)
if (res != NULL)
snmp_free_pdu (res);
if (res != NULL)
snmp_free_pdu (res);
- res = NULL;
sfree (errstr);
sfree (vl.values);
sfree (errstr);
sfree (vl.values);