Blame SOURCES/autofs-5.1.0-fix-mem-leak-in-create_client.patch

304803
autofs-5.1.0 - fix memory leak in create_client()
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
In create_client(), if the target host is unreachable the function
304803
exists without freeing the addrinfo data returned from getaddrinfo(3).
304803
---
304803
 CHANGELOG      |    1 +
304803
 lib/rpc_subs.c |    4 +++-
304803
 2 files changed, 4 insertions(+), 1 deletion(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -148,6 +148,7 @@
304803
 - add mutex call return check in defaults.c.
304803
 - force disable browse mode for amd format maps.
304803
 - fix hosts map options check in lookup_amd_instance().
304803
+- fix memory leak in create_client().
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/lib/rpc_subs.c
304803
+++ autofs-5.0.7/lib/rpc_subs.c
304803
@@ -719,8 +719,10 @@ static int create_client(struct conn_inf
304803
 		ret = rpc_do_create_client(haddr->ai_addr, info, &fd, client);
304803
 		if (ret == 0)
304803
 			break;
304803
-		if (ret == -EHOSTUNREACH)
304803
+		if (ret == -EHOSTUNREACH) {
304803
+			freeaddrinfo(ai);
304803
 			goto out_close;
304803
+		}
304803
 
304803
 		if (!info->client && fd != RPC_ANYSOCK) {
304803
 			close(fd);