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

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