From 91590b1ae7c43a3c251407c947a973cbf58d7ba4 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 9 Dec 2016 17:20:43 +0100 Subject: [PATCH] email plugin: initialize structure CID 38125 --- src/email.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.30.2