mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-29 02:59:34 -05:00
fix SLAPI_MODIFY_MODS pointer error
This commit is contained in:
parent
84918362df
commit
8ab0c4d401
1 changed files with 5 additions and 1 deletions
|
|
@ -809,6 +809,7 @@ static LDAPMod **Modifications2LDAPMods(Modifications **pmodlist)
|
|||
sizeof(struct berval *) );
|
||||
for( j = 0; ml->sml_bvalues[j].bv_val != NULL; j++ ) {
|
||||
/* Take ownership of original values. */
|
||||
modp->mod_bvalues[j] = (struct berval *)ch_malloc( sizeof(struct berval) );
|
||||
modp->mod_bvalues[j]->bv_len = ml->sml_bvalues[j].bv_len;
|
||||
modp->mod_bvalues[j]->bv_val = ml->sml_bvalues[j].bv_val;
|
||||
ml->sml_bvalues[j].bv_len = 0;
|
||||
|
|
@ -896,7 +897,7 @@ static Modifications *LDAPMods2Modifications (LDAPMod **mods)
|
|||
*/
|
||||
static void FreeLDAPMods (LDAPMod **mods)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
if (mods == NULL)
|
||||
return;
|
||||
|
|
@ -907,6 +908,9 @@ static void FreeLDAPMods (LDAPMod **mods)
|
|||
* Modification list. Do free the containing array.
|
||||
*/
|
||||
if ( mods[i]->mod_op & LDAP_MOD_BVALUES ) {
|
||||
for ( j = 0; mods[i]->mod_bvalues[j] != NULL; j++ ) {
|
||||
ch_free( mods[i]->mod_bvalues[j] );
|
||||
}
|
||||
ch_free( mods[i]->mod_bvalues );
|
||||
} else {
|
||||
ch_free( mods[i]->mod_values );
|
||||
|
|
|
|||
Loading…
Reference in a new issue