Blob Blame Raw
From 00a0b5f1d506f5f79f4b27859355db8d5a70a249 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Thu, 12 Dec 2013 15:36:11 -0500
Subject: [PATCH 67/78] Ticket 47620 - Fix cherry-pick error for 1.3.2 and
 1.3.1

Description:  During the cherry-pick process I had to make some manual changes,
              and there were two schedule_destroy() calls made which lead to
              a dereferenced point.

https://fedorahosted.org/389/ticket/47620

Reviewed by: rmeggins(Thanks!)
(cherry picked from commit 3ae6900d8269926a1da097e3818aa444137aa9d9)
(cherry picked from commit 5d4ac7c8c5d48be0796cdbf2ae7b9c40460de18c)
---
 ldap/servers/plugins/replication/repl5_agmt.c     | 2 --
 ldap/servers/plugins/replication/repl5_schedule.c | 4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
index b0da172..14c2fb4 100644
--- a/ldap/servers/plugins/replication/repl5_agmt.c
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
@@ -630,8 +630,6 @@ agmt_delete(void **rap)
 	PR_DestroyLock(ra->lock);
 	slapi_destroy_rwlock(ra->attr_lock);
 
-	schedule_destroy(ra->schedule);
-	slapi_ch_free((void **)&ra->long_name);
 	slapi_ch_free((void **)rap);
 }
 
diff --git a/ldap/servers/plugins/replication/repl5_schedule.c b/ldap/servers/plugins/replication/repl5_schedule.c
index 419e3ec..1db06a6 100644
--- a/ldap/servers/plugins/replication/repl5_schedule.c
+++ b/ldap/servers/plugins/replication/repl5_schedule.c
@@ -159,6 +159,10 @@ schedule_destroy(Schedule *s)
 {
 	int i;
 
+	if(s == NULL){
+	    return;
+	}
+
     /* unschedule update window event if exists */
     unschedule_window_state_change_event (s);
 
-- 
1.8.1.4