X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsnmp.c;h=084925586d1f7eb37936e5ad1db5cddf7865462c;hb=69b8a9a1af204685dfdfaf1279a0f2928e0bbb32;hp=6a5bb8b964802af92ffad9d600e1255e2ed3a4d8;hpb=ab11d1b4db61f750f51be6e41dbe8320d3c65404;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index 6a5bb8b9..08492558 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -641,7 +641,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) @@ -772,7 +772,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; @@ -942,9 +941,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); @@ -1276,7 +1274,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;