From 68fd4449af780445f0143512a51dfb3d8e60ffb4 Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Wed, 13 Sep 2017 09:24:03 -0400 Subject: [PATCH] Ticket 49380 - Crash when adding invalid replication agreement Bug Description: If you add a replication agreement with an invalid "replicaEnabled" value the server crashes when freeing the replica schedule. This is because the schedule never gets allocated before the rror conidtion is hit, and then it get dereferenced. Fix Description: Check for a NULL schedule before trying to destroy it. https://pagure.io/389-ds-base/issue/49380 Reviewed by: ? --- ldap/servers/plugins/replication/repl5_schedule.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldap/servers/plugins/replication/repl5_schedule.c b/ldap/servers/plugins/replication/repl5_schedule.c index 790d961..af69565 100644 --- a/ldap/servers/plugins/replication/repl5_schedule.c +++ b/ldap/servers/plugins/replication/repl5_schedule.c @@ -130,6 +130,9 @@ schedule_destroy(Schedule *s) { int i; + if (s == NULL) { + return; + } /* unschedule update window event if exists */ unschedule_window_state_change_event(s); -- 2.9.5