From 5769e192e220b8630b7ed6edc22b11d10f94730a Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: May 21 2012 15:56:27 +0000 Subject: Ticket #321 - krbExtraData is being null modified and replicated on each ssh login Bug Description: Crash during IPA install Fix Description: Have to free the mod before moving the unremoved mods down the list on top of the freed mod. Reviewed by: mreynolds (Thanks!) (cherry picked from commit 758a68db83c653187203d683c9d9a71742314be5) --- diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c index 3327405..30d211a 100644 --- a/ldap/servers/plugins/replication/repl5_protocol_util.c +++ b/ldap/servers/plugins/replication/repl5_protocol_util.c @@ -707,6 +707,11 @@ repl5_strip_fractional_mods(Repl_Agmt *agmt, LDAPMod ** mods) */ if (0 == slapi_attr_type_cmp(mods[j]->mod_type, a[i], SLAPI_TYPE_CMP_SUBTYPE)) { + /* Adjust value of j, implicit in not incrementing it */ + /* Free this mod */ + ber_bvecfree(mods[j]->mod_bvalues); + slapi_ch_free((void **)&(mods[j]->mod_type)); + slapi_ch_free((void **)&mods[j]); /* Move down all subsequent mods */ for (k = j; mods[k+1] ; k++) { @@ -714,11 +719,6 @@ repl5_strip_fractional_mods(Repl_Agmt *agmt, LDAPMod ** mods) } /* Zero the end of the array */ mods[k] = NULL; - /* Adjust value of j, implicit in not incrementing it */ - /* Free this mod */ - ber_bvecfree(mods[j]->mod_bvalues); - slapi_ch_free((void **)&(mods[j]->mod_type)); - slapi_ch_free((void **)&mods[j]); } else { j++; }