From: Florian Forster Date: Wed, 17 Jun 2015 05:50:46 +0000 (+0200) Subject: network plugin: Explicitly initialize "fd_num" to zero. X-Git-Tag: collectd-5.5.1~110^2~3 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6efc94f59c38e86309078fb9e20c78a2e9c8ff59;p=collectd.git 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. --- 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;