From d6bc0d17efe54a1dd7110547aae4b1bb6e223bb7 Mon Sep 17 00:00:00 2001 From: Ken Hornstein Date: Mon, 6 Feb 2012 11:31:18 -0500 Subject: [PATCH] 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). --- sbr/client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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); } -- 1.7.10.4