libcollectdclient: free result of getaddrinfo
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sat, 5 Dec 2015 11:09:00 +0000 (12:09 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 20:26:17 +0000 (21:26 +0100)
CID #37997

Signed-off-by: Florian Forster <octo@collectd.org>
src/libcollectdclient/client.c

index 5db98e5..802e643 100644 (file)
@@ -526,9 +526,11 @@ static int lcc_open_netsocket (lcc_connection_t *c, /* {{{ */
   if (status != 0)
   {
     lcc_set_errno (c, status);
+    freeaddrinfo (ai_res);
     return (-1);
   }
 
+  freeaddrinfo (ai_res);
   return (0);
 } /* }}} int lcc_open_netsocket */