From: Ken Hornstein Date: Fri, 16 Jan 2009 15:48:09 +0000 (+0000) Subject: Move freeaddrinfo() to inside of our loop; this prevents a memory leak X-Git-Tag: PRE_POSIX_CONVERSION~14 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=d6ed7408ae67cf31b31a8c42515a160f7dc6330a;p=mmh Move freeaddrinfo() to inside of our loop; this prevents a memory leak and also prevents it from being called with a NULL pointer. --- diff --git a/sbr/client.c b/sbr/client.c index ae6968f..732fb47 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -111,9 +111,10 @@ client (char *args, char *service, char *response, int len_response, int debug) close(sd); } + + freeaddrinfo(res); } - freeaddrinfo(res); client_freelist(ap); strncpy (response, "no servers available", len_response); return NOTOK;