Blame SOURCES/autofs-5.1.0-fix-leak-in-get_network_proximity.patch

6bbd11
autofs-5.1.0 - fix leak in get_network_proximity()
6bbd11
6bbd11
From: Ian Kent <raven@themaw.net>
6bbd11
6bbd11
Fix variable net not freed after use in get_network_proximity().
6bbd11
---
6bbd11
 CHANGELOG        |    1 +
6bbd11
 lib/parse_subs.c |    5 +++--
6bbd11
 2 files changed, 4 insertions(+), 2 deletions(-)
6bbd11
6bbd11
--- autofs-5.0.7.orig/CHANGELOG
6bbd11
+++ autofs-5.0.7/CHANGELOG
6bbd11
@@ -136,6 +136,7 @@
6bbd11
 - fix memory leak in conf_amd_get_log_options().
6bbd11
 - fix signed comparison in inet_fill_net().
6bbd11
 - fix buffer size checks in get_network_proximity().
6bbd11
+- fix leak in get_network_proximity().
6bbd11
 
6bbd11
 25/07/2012 autofs-5.0.7
6bbd11
 =======================
6bbd11
--- autofs-5.0.7.orig/lib/parse_subs.c
6bbd11
+++ autofs-5.0.7/lib/parse_subs.c
6bbd11
@@ -446,9 +446,10 @@ unsigned int get_network_proximity(const
6bbd11
 		return PROXIMITY_ERROR;
6bbd11
 
6bbd11
 	net = get_network_number(name);
6bbd11
-	if (net)
6bbd11
+	if (net) {
6bbd11
 		strcpy(name_or_num, net);
6bbd11
-	else {
6bbd11
+		free(net);
6bbd11
+	} else {
6bbd11
 		char this[NI_MAXHOST + 1];
6bbd11
 		char *mask;
6bbd11