X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fpowerdns.c;h=958a3410075788378ac0015d17974a6bebd255d7;hb=063a5e75b36173e89ffa18d32d47509f6ef968ec;hp=1c41ff8d62ab31a5dca62ee5ac5f0746b8c2ad89;hpb=43aca8ed8b22a7a5a14f8c740948d6ce06efbc95;p=collectd.git diff --git a/src/powerdns.c b/src/powerdns.c index 1c41ff8d..958a3410 100644 --- a/src/powerdns.c +++ b/src/powerdns.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -375,7 +376,7 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ char *buffer = NULL; size_t buffer_size = 0; - struct sockaddr_un sa_unix; + struct sockaddr_un sa_unix = { 0 }; struct timeval stv_timeout; cdtime_t cdt_timeout; @@ -387,7 +388,6 @@ static int powerdns_get_data_dgram (list_item_t *item, /* {{{ */ return (-1); } - memset (&sa_unix, 0, sizeof (sa_unix)); sa_unix.sun_family = AF_UNIX; sstrncpy (sa_unix.sun_path, (local_sockpath != NULL) ? local_sockpath : PDNS_LOCAL_SOCKPATH, @@ -542,7 +542,7 @@ static int powerdns_get_data_stream (list_item_t *item, /* {{{ */ else if (status == 0) break; - buffer_new = (char *) realloc (buffer, buffer_size + status + 1); + buffer_new = realloc (buffer, buffer_size + status + 1); if (buffer_new == NULL) { FUNC_ERROR ("realloc"); @@ -799,7 +799,7 @@ static int powerdns_config_add_collect (list_item_t *li, /* {{{ */ return (-1); } - temp = (char **) realloc (li->fields, + temp = realloc (li->fields, sizeof (char *) * (li->fields_num + ci->values_num)); if (temp == NULL) {