Blame SOURCES/0033-Ticket-50490-objects-and-memory-leaks.patch

8394b4
From ffeb3389c2682b41db28062a48ff555875330098 Mon Sep 17 00:00:00 2001
8394b4
From: Ludwig Krispenz <lkrispen@redhat.com>
8394b4
Date: Thu, 1 Aug 2019 10:40:33 +0200
8394b4
Subject: [PATCH] Ticket 50490 objects and memory leaks
8394b4
8394b4
Bug: There are severalmemory leaks for replication objects
8394b4
8394b4
Fix: This patch contains a couple of fixes:
8394b4
8394b4
	- The balance of acquire and release for a replica object was incorrect,
8394b4
	but the object is allocated at startup or when a replica is added and
8394b4
	destroyed at shutdown. In between we know the replica exists and can be accessed directly
8394b4
	To ensure that no access was made until it is destroyed the shutdown order was
8394b4
	slightly modifed
8394b4
8394b4
	- other objects like RUV or AGMT were also not always correctly balanced, this
8394b4
	is corrected
8394b4
8394b4
	- in cl5_api where many types of objects are used, the variable names were changed
8394b4
	to bettr indicat to what an object refers
8394b4
8394b4
	- some other leaks, eg in repl5_total_init or op_shared_add were fixed
8394b4
8394b4
	- unused code has been removed
8394b4
8394b4
Reviewed by: William, Thierry, Mark - thanks
8394b4
---
8394b4
 ldap/servers/plugins/replication/repl5_replica_config.c | 1 +
8394b4
 1 file changed, 1 insertion(+)
8394b4
8394b4
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
8394b4
index 02b36f6ad..238522b54 100644
8394b4
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
8394b4
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
8394b4
@@ -769,6 +769,7 @@ replica_config_delete(Slapi_PBlock *pb __attribute__((unused)),
8394b4
                       slapi_sdn_get_dn(replica_get_root(r)));
8394b4
         cl5DeleteDBSync(r);
8394b4
         replica_delete_by_name(replica_get_name(r));
8394b4
+        mtnode_ext->replica = NULL;
8394b4
     }
8394b4
 
8394b4
     PR_Unlock(s_configLock);
8394b4
-- 
8394b4
2.21.1
8394b4