From d6ed7408ae67cf31b31a8c42515a160f7dc6330a Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Fri, 16 Jan 2009 15:48:09 +0000 Subject: [PATCH] Move freeaddrinfo() to inside of our loop; this prevents a memory leak and also prevents it from being called with a NULL pointer. --- sbr/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 1.7.10.4