Blame SOURCES/0067-Ticket-47620-Fix-cherry-pick-error-for-1.3.2-and-1.3.patch

cc3dff
From 00a0b5f1d506f5f79f4b27859355db8d5a70a249 Mon Sep 17 00:00:00 2001
cc3dff
From: Mark Reynolds <mreynolds@redhat.com>
cc3dff
Date: Thu, 12 Dec 2013 15:36:11 -0500
cc3dff
Subject: [PATCH 67/78] Ticket 47620 - Fix cherry-pick error for 1.3.2 and
cc3dff
 1.3.1
cc3dff
cc3dff
Description:  During the cherry-pick process I had to make some manual changes,
cc3dff
              and there were two schedule_destroy() calls made which lead to
cc3dff
              a dereferenced point.
cc3dff
cc3dff
https://fedorahosted.org/389/ticket/47620
cc3dff
cc3dff
Reviewed by: rmeggins(Thanks!)
cc3dff
(cherry picked from commit 3ae6900d8269926a1da097e3818aa444137aa9d9)
cc3dff
(cherry picked from commit 5d4ac7c8c5d48be0796cdbf2ae7b9c40460de18c)
cc3dff
---
cc3dff
 ldap/servers/plugins/replication/repl5_agmt.c     | 2 --
cc3dff
 ldap/servers/plugins/replication/repl5_schedule.c | 4 ++++
cc3dff
 2 files changed, 4 insertions(+), 2 deletions(-)
cc3dff
cc3dff
diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c
cc3dff
index b0da172..14c2fb4 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl5_agmt.c
cc3dff
+++ b/ldap/servers/plugins/replication/repl5_agmt.c
cc3dff
@@ -630,8 +630,6 @@ agmt_delete(void **rap)
cc3dff
 	PR_DestroyLock(ra->lock);
cc3dff
 	slapi_destroy_rwlock(ra->attr_lock);
cc3dff
 
cc3dff
-	schedule_destroy(ra->schedule);
cc3dff
-	slapi_ch_free((void **)&ra->long_name);
cc3dff
 	slapi_ch_free((void **)rap);
cc3dff
 }
cc3dff
 
cc3dff
diff --git a/ldap/servers/plugins/replication/repl5_schedule.c b/ldap/servers/plugins/replication/repl5_schedule.c
cc3dff
index 419e3ec..1db06a6 100644
cc3dff
--- a/ldap/servers/plugins/replication/repl5_schedule.c
cc3dff
+++ b/ldap/servers/plugins/replication/repl5_schedule.c
cc3dff
@@ -159,6 +159,10 @@ schedule_destroy(Schedule *s)
cc3dff
 {
cc3dff
 	int i;
cc3dff
 
cc3dff
+	if(s == NULL){
cc3dff
+	    return;
cc3dff
+	}
cc3dff
+
cc3dff
     /* unschedule update window event if exists */
cc3dff
     unschedule_window_state_change_event (s);
cc3dff
 
cc3dff
-- 
cc3dff
1.8.1.4
cc3dff