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

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