From 540db4f5a99ac3f36797e39f54e32f773ac669eb Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 28 Nov 2014 00:42:37 +1100 Subject: [PATCH] Free the addrinfo allocated in bind_socket --- src/libckpool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libckpool.c b/src/libckpool.c index f4a28271..aa2ab7c4 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -509,7 +509,7 @@ int bind_socket(char *url, char *port) if (getaddrinfo(url, port, &hints, &servinfo) != 0) { LOGWARNING("Failed to resolve (?wrong URL) %s:%s", url, port); - goto out; + return sockd; } for (p = servinfo; p != NULL; p = p->ai_next) { sockd = socket(p->ai_family, p->ai_socktype, p->ai_protocol); @@ -529,6 +529,7 @@ int bind_socket(char *url, char *port) } out: + freeaddrinfo(servinfo); return sockd; }