From: Ken Hornstein Date: Mon, 6 Feb 2012 16:31:18 +0000 (-0500) Subject: Patch from Harvey Eneman: fixes problem on some systems where a free() X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=d6bc0d17efe54a1dd7110547aae4b1bb6e223bb7;p=mmh Patch from Harvey Eneman: fixes problem on some systems where a free() would be called on non-malloc'd memory (only would happen if you had more than one entry in the server: line in mts.conf). --- diff --git a/sbr/client.c b/sbr/client.c index 7ae356a..7ab49a9 100644 --- a/sbr/client.c +++ b/sbr/client.c @@ -95,7 +95,7 @@ client (char *args, char *service, char *response, int len_response, int debug) if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) { freeaddrinfo(res); - client_freelist(ap); + client_freelist(arguments); return sd; } @@ -109,7 +109,7 @@ client (char *args, char *service, char *response, int len_response, int debug) freeaddrinfo(res); } - client_freelist(ap); + client_freelist(arguments); strncpy (response, "no servers available", len_response); return NOTOK; } @@ -122,8 +122,7 @@ client (char *args, char *service, char *response, int len_response, int debug) static void client_freelist(char **list) { - while (*list++ != NULL) - free(*list); + free(*list); }