X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsnmp.c;h=60bec83c4ba532457dea21135632c37ed33dad92;hb=aef788ac8927ffa74429daaffb572566fae782ec;hp=89cbc46016db0610e5e2e6f71f234b2eedcaa495;hpb=354f9991530248e45207d236eb74c1cc3d5238ef;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 89cbc460..60bec83c 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -25,12 +25,11 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "utils_complain.h" -#include - #include #include @@ -643,7 +642,7 @@ static int csnmp_config_add_host (oconfig_item_t *ci) /* Registration stuff. */ char cb_name[DATA_MAX_NAME_LEN]; - user_data_t cb_data; + user_data_t cb_data = { 0 }; hd = calloc (1, sizeof (*hd)); if (hd == NULL) @@ -774,7 +773,6 @@ static int csnmp_config_add_host (oconfig_item_t *ci) ssnprintf (cb_name, sizeof (cb_name), "snmp-%s", hd->name); - memset (&cb_data, 0, sizeof (cb_data)); cb_data.data = hd; cb_data.free_func = csnmp_host_definition_destroy; @@ -944,9 +942,8 @@ static value_t csnmp_value_list_to_value (struct variable_list *vl, int type, } else { - char oid_buffer[1024]; + char oid_buffer[1024] = { 0 }; - memset (oid_buffer, 0, sizeof (oid_buffer)); snprint_objid (oid_buffer, sizeof (oid_buffer) - 1, vl->name, vl->name_length); @@ -1278,7 +1275,6 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat vl.interval = host->interval; have_more = 1; - memset (¤t_suffix, 0, sizeof (current_suffix)); while (have_more) { _Bool suffix_skipped = 0;