X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fdaemon%2Fcommon.c;h=ff2e51990f797f5a6256b37c7fe05b3c44618a22;hb=4103105fb43cd72294f165b2541540b3a8a99532;hp=f9b1433b3a5d86f6004c015f79b8206cfc854403;hpb=21ab7512825cf8177d5eee5101344b45d0854610;p=collectd.git diff --git a/src/daemon/common.c b/src/daemon/common.c index f9b1433b..ff2e5199 100644 --- a/src/daemon/common.c +++ b/src/daemon/common.c @@ -32,6 +32,7 @@ #endif #include "collectd.h" + #include "common.h" #include "plugin.h" #include "utils_cache.h" @@ -1518,16 +1519,15 @@ int service_name_to_port_number (const char *service_name) { struct addrinfo *ai_list; struct addrinfo *ai_ptr; - struct addrinfo ai_hints; int status; int service_number; if (service_name == NULL) return (-1); - ai_list = NULL; - memset (&ai_hints, 0, sizeof (ai_hints)); - ai_hints.ai_family = AF_UNSPEC; + struct addrinfo ai_hints = { + .ai_family = AF_UNSPEC + }; status = getaddrinfo (/* node = */ NULL, service_name, &ai_hints, &ai_list);