X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fzookeeper.c;h=a236c8ae66404bd5173c0be7e2537246e34511f4;hb=3fae5596643f1e361eb18c3d65448f8bc02fdd80;hp=1eed1fb35d1b02281ea050cc12d9cffa250e2270;hpb=36ee20dc97d0e0a5483892667f5d032618e18f10;p=collectd.git diff --git a/src/zookeeper.c b/src/zookeeper.c index 1eed1fb3..a236c8ae 100644 --- a/src/zookeeper.c +++ b/src/zookeeper.c @@ -105,13 +105,12 @@ static int zookeeper_connect (void) { int sk = -1; int status; - struct addrinfo ai_hints; + struct addrinfo ai_hints = { 0 }; struct addrinfo *ai; struct addrinfo *ai_list; const char *host; const char *port; - memset ((void *) &ai_hints, '\0', sizeof (ai_hints)); ai_hints.ai_family = AF_UNSPEC; ai_hints.ai_socktype = SOCK_STREAM; @@ -159,8 +158,7 @@ static int zookeeper_connect (void) static int zookeeper_query (char *buffer, size_t buffer_size) { - int sk = -1; - int status; + int sk, status; size_t buffer_fill; sk = zookeeper_connect();