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

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