Blame SOURCES/autofs-5.0.7-try-and-cleanup-after-dumpmaps.patch

4d476f
autofs-5.0.7 - try and cleanup after dumpmaps
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
Try and cleanup a little after dumping maps.
4d476f
It's not really necessary but but can help by reducing the noise
4d476f
from valgrind when checking code.
4d476f
---
4d476f
 CHANGELOG          |    1 +
4d476f
 daemon/automount.c |   13 +++++++++++++
4d476f
 lib/master.c       |    2 ++
4d476f
 3 files changed, 16 insertions(+)
4d476f
4d476f
--- autofs-5.0.7.orig/CHANGELOG
4d476f
+++ autofs-5.0.7/CHANGELOG
4d476f
@@ -59,6 +59,7 @@
4d476f
 - fix syncronize handle_mounts() shutdown.
4d476f
 - fix fix wildcard multi map regression.
4d476f
 - fix dumpmaps multi output.
4d476f
+- try and cleanup after dumpmaps.
4d476f
 
4d476f
 25/07/2012 autofs-5.0.7
4d476f
 =======================
4d476f
--- autofs-5.0.7.orig/daemon/automount.c
4d476f
+++ autofs-5.0.7/daemon/automount.c
4d476f
@@ -2136,6 +2136,8 @@ int main(int argc, char *argv[])
4d476f
 	}
4d476f
 
4d476f
 	if (dumpmaps) {
4d476f
+		struct master_mapent *entry;
4d476f
+		struct list_head *head, *p;
4d476f
 		struct mapent_cache *nc;
4d476f
 
4d476f
 		open_log();
4d476f
@@ -2152,6 +2154,17 @@ int main(int argc, char *argv[])
4d476f
 
4d476f
 		lookup_nss_read_master(master_list, 0);
4d476f
 		master_show_mounts(master_list);
4d476f
+
4d476f
+		head = &master_list->mounts;
4d476f
+		p = head->next;
4d476f
+		while (p != head) {
4d476f
+			entry = list_entry(p, struct master_mapent, list);
4d476f
+			p = p->next;
4d476f
+			master_free_mapent_sources(entry, 1);
4d476f
+			master_free_mapent(entry);
4d476f
+		}
4d476f
+		master_kill(master_list);
4d476f
+
4d476f
 		exit(0);
4d476f
 	}
4d476f
 
4d476f
--- autofs-5.0.7.orig/lib/master.c
4d476f
+++ autofs-5.0.7/lib/master.c
4d476f
@@ -1426,6 +1426,8 @@ int master_show_mounts(struct master *ma
4d476f
 			source = source->next;
4d476f
 		}
4d476f
 
4d476f
+		lookup_close_lookup(ap);
4d476f
+
4d476f
 		printf("\n");
4d476f
 	}
4d476f