Plug memory leaks

This commit is contained in:
Hallvard Furuseth 1999-04-04 21:34:33 +00:00
parent d60bcb02c4
commit 2b32e6afd7
2 changed files with 11 additions and 6 deletions

View File

@ -371,9 +371,7 @@ idl_insert_key(
idl_free( idl );
idl = idl_allids( be );
rc = idl_store( be, db, key, idl );
idl_free( idl );
return( rc );
break;
}
idl_split_block( idl, id, &tmp, &tmp2 );
@ -442,6 +440,7 @@ idl_insert_key(
Debug( LDAP_DEBUG_ANY, "nonexistent continuation block (%s)\n",
k2.dptr, 0, 0 );
free( kstr );
idl_free( idl );
return( -1 );
}
@ -510,10 +509,9 @@ idl_insert_key(
return( 0 );
case 3: /* split the original block */
idl_free( tmp2 );
break;
}
idl_free( tmp2 );
}
/*
@ -703,10 +701,12 @@ idl_delete_key (
idl_store( be, db, key, idl );
}
idl_free( idl );
return 0;
}
/* We didn't find the ID. Hmmm... */
}
idl_free( idl );
return -1;
}
@ -759,12 +759,16 @@ idl_delete_key (
else
idl_store( be, db, key, idl );
}
idl_free( tmp );
free( kstr );
idl_free( idl );
return 0;
}
}
idl_free( tmp );
}
free( kstr );
idl_free( idl );
return -1;
}

View File

@ -181,6 +181,7 @@ read_config( char *fname )
char *dn = ch_strdup( cargv[1] );
(void) dn_normalize_case( dn );
charray_add( &be->be_suffix, dn );
free( dn );
}
/* set database suffixAlias */
@ -421,7 +422,7 @@ read_config( char *fname )
if ( strncasecmp( cargv[i], "host=", 5 )
== 0 ) {
charray_add( &be->be_replica,
ch_strdup( cargv[i] + 5 ) );
cargv[i] + 5 );
break;
}
}