From: Ruben Kerkhof Date: Fri, 9 Dec 2016 16:20:43 +0000 (+0100) Subject: email plugin: initialize structure X-Git-Tag: collectd-5.7.0~1 X-Git-Url: https://git.tokkee.org/?p=collectd.git;a=commitdiff_plain;h=91590b1ae7c43a3c251407c947a973cbf58d7ba4 email plugin: initialize structure CID 38125 --- diff --git a/src/email.c b/src/email.c index b406d483..34e99984 100644 --- a/src/email.c +++ b/src/email.c @@ -361,8 +361,6 @@ static void *collect(void *arg) { } /* static void *collect (void *) */ static void *open_connection(void __attribute__((unused)) * arg) { - struct sockaddr_un addr; - const char *path = (NULL == sock_file) ? SOCK_PATH : sock_file; const char *group = (NULL == sock_group) ? COLLECTD_GRP_NAME : sock_group; @@ -375,7 +373,9 @@ static void *open_connection(void __attribute__((unused)) * arg) { pthread_exit((void *)1); } - addr.sun_family = AF_UNIX; + struct sockaddr_un addr = { + .sun_family = AF_UNIX + }; sstrncpy(addr.sun_path, path, (size_t)(UNIX_PATH_MAX - 1)); errno = 0;