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

6bbd11
autofs-5.1.0 - fix leak in cache_push_mapent()
6bbd11
6bbd11
From: Ian Kent <raven@themaw.net>
6bbd11
6bbd11
cache_push_mapent() incorectly sets the cache entry mapent to the old
6bbd11
value which causes a memory leak when the new map entry isn't NULL.
6bbd11
---
6bbd11
 CHANGELOG   |    1 +
6bbd11
 lib/cache.c |    2 +-
6bbd11
 2 files changed, 2 insertions(+), 1 deletion(-)
6bbd11
6bbd11
--- autofs-5.0.7.orig/CHANGELOG
6bbd11
+++ autofs-5.0.7/CHANGELOG
6bbd11
@@ -130,6 +130,7 @@
6bbd11
 - dont allocate dev_ctl_ops too early.
6bbd11
 - fix incorrect round robin host detection.
6bbd11
 - fix race accessing qdn in get_query_dn().
6bbd11
+- fix leak in cache_push_mapent().
6bbd11
 
6bbd11
 25/07/2012 autofs-5.0.7
6bbd11
 =======================
6bbd11
--- autofs-5.0.7.orig/lib/cache.c
6bbd11
+++ autofs-5.0.7/lib/cache.c
6bbd11
@@ -203,7 +203,7 @@ int cache_push_mapent(struct mapent *me,
6bbd11
 
6bbd11
 	s->mapent = me->mapent;
6bbd11
 	s->age = me->age;
6bbd11
-	me->mapent = mapent;
6bbd11
+	me->mapent = new;
6bbd11
 
6bbd11
 	if (me->stack)
6bbd11
 		s->next = me->stack;