Blame SOURCES/autofs-5.0.7-fix-memory-leak-in-get_dc_list.patch

ab3a3d
autofs-5.0.7 - fix memory leak in get_dc_list()
ab3a3d
ab3a3d
From: Ian Kent <raven@themaw.net>
ab3a3d
ab3a3d
In get_dc_list() if an invalid port is found the allocated list storage
ab3a3d
isn't freed on the error exit.
ab3a3d
---
ab3a3d
 modules/dclist.c |    2 ++
ab3a3d
 1 file changed, 2 insertions(+)
ab3a3d
ab3a3d
diff --git a/modules/dclist.c b/modules/dclist.c
ab3a3d
index d16b913..af21ce0 100644
ab3a3d
--- a/modules/dclist.c
ab3a3d
+++ b/modules/dclist.c
ab3a3d
@@ -536,6 +536,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri)
ab3a3d
 		else
ab3a3d
 			strcat(tmp, " ");
ab3a3d
 
ab3a3d
+		list = NULL;
ab3a3d
 		for (i = 0; i < numdcs; i++) {
ab3a3d
 			if (i > 0)
ab3a3d
 				strcat(tmp, " ");
ab3a3d
@@ -549,6 +550,7 @@ struct dclist *get_dc_list(unsigned int logopt, const char *uri)
ab3a3d
 					error(logopt,
ab3a3d
 					      "invalid port: %u", dcs[i].port);
ab3a3d
 					free_srv_rrs(dcs, numdcs);
ab3a3d
+					free(tmp);
ab3a3d
 					goto out_error;
ab3a3d
 				}
ab3a3d
 				strcat(tmp, port);