Blame SOURCES/0040-Ticket-47969-COS-memory-leak-when-rebuilding-the-cac.patch

f92ce9
From cedd8dde2e4e16c883569fe900da317e9d0d69e9 Mon Sep 17 00:00:00 2001
f92ce9
From: Mark Reynolds <mreynolds@redhat.com>
f92ce9
Date: Tue, 2 Dec 2014 13:38:06 -0500
f92ce9
Subject: [PATCH 40/53] Ticket 47969 - COS memory leak when rebuilding the
f92ce9
 cache
f92ce9
f92ce9
Bug Description:  When the COS cache is released, not all of the schema
f92ce9
                  objectclasses are freed.  So every time we rebuild the
f92ce9
                  COS cache we leak memory.
f92ce9
f92ce9
Fix Description:  After we free the schema attributes, the very first
f92ce9
                  attribute still needs to be freed.  It is not freed
f92ce9
                  initially because of the duplicate checking logic, so
f92ce9
                  it is now done after the loop.
f92ce9
f92ce9
https://fedorahosted.org/389/ticket/47969
f92ce9
f92ce9
Reviewed by: nhosoi(Thanks!)
f92ce9
f92ce9
(cherry picked from commit d2dfda95c543f106443f898436151b00c68e4270)
f92ce9
(cherry picked from commit bc47239c5c7e6d19564fcd2839c6f2bd81a5b540)
f92ce9
---
f92ce9
 ldap/servers/plugins/cos/cos_cache.c | 2 ++
f92ce9
 1 file changed, 2 insertions(+)
f92ce9
f92ce9
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
f92ce9
index a7993c8..fd163f9 100644
f92ce9
--- a/ldap/servers/plugins/cos/cos_cache.c
f92ce9
+++ b/ldap/servers/plugins/cos/cos_cache.c
f92ce9
@@ -1864,6 +1864,8 @@ static void cos_cache_del_schema(cosCache *pCache)
f92ce9
 			}
f92ce9
 		}
f92ce9
 	}
f92ce9
+	/* Finally, remove the first attribute's objectclass list */
f92ce9
+	cos_cache_del_attrval_list(&(pCache->ppAttrIndex[0]->pObjectclasses));
f92ce9
 
f92ce9
 	LDAPDebug( LDAP_DEBUG_TRACE, "<-- cos_cache_del_schema\n",0,0,0);
f92ce9
 }
f92ce9
-- 
f92ce9
1.9.3
f92ce9