From 6efc94f59c38e86309078fb9e20c78a2e9c8ff59 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 17 Jun 2015 07:50:46 +0200 Subject: [PATCH] network plugin: Explicitly initialize "fd_num" to zero. I have the feeling that initialization via memset() and unions in the sockent structure confuse clang's scan-build. --- src/network.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/network.c b/src/network.c index 5d485ba3..c5fd256f 100644 --- a/src/network.c +++ b/src/network.c @@ -2017,6 +2017,7 @@ static sockent_t *sockent_create (int type) /* {{{ */ if (type == SOCKENT_TYPE_SERVER) { se->data.server.fd = NULL; + se->data.server.fd_num = 0; #if HAVE_LIBGCRYPT se->data.server.security_level = SECURITY_LEVEL_NONE; se->data.server.auth_file = NULL; @@ -2212,6 +2213,9 @@ static int sockent_server_listen (sockent_t *se) /* {{{ */ if (se == NULL) return (-1); + assert (se->data.server.fd == NULL); + assert (se->data.server.fd_num == 0); + node = se->node; service = se->service; -- 2.11.0