From: Hallvard Furuseth Date: Sat, 7 Aug 1999 03:38:24 +0000 (+0000) Subject: Plug memory leaks (parallell to back-ldbm/idl.c version 1.26) X-Git-Tag: TWEB_OL_BASE~266 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8e03d254b8df3fddb82678f76f78c0db5f8e722b;p=openldap Plug memory leaks (parallell to back-ldbm/idl.c version 1.26) --- diff --git a/servers/slapd/back-bdb2/idl.c b/servers/slapd/back-bdb2/idl.c index 07fe1d8261..3c75278475 100644 --- a/servers/slapd/back-bdb2/idl.c +++ b/servers/slapd/back-bdb2/idl.c @@ -371,9 +371,7 @@ bdb2i_idl_insert_key( bdb2i_idl_free( idl ); idl = bdb2i_idl_allids( be ); rc = idl_store( be, db, key, idl ); - bdb2i_idl_free( idl ); - - return( rc ); + break; } idl_split_block( idl, id, &tmp, &tmp2 ); @@ -442,6 +440,7 @@ bdb2i_idl_insert_key( Debug( LDAP_DEBUG_ANY, "nonexistent continuation block (%s)\n", k2.dptr, 0, 0 ); free( kstr ); + bdb2i_idl_free( idl ); return( -1 ); } @@ -510,10 +509,9 @@ bdb2i_idl_insert_key( return( 0 ); case 3: /* split the original block */ - bdb2i_idl_free( tmp2 ); break; } - + bdb2i_idl_free( tmp2 ); } /* @@ -703,10 +701,12 @@ bdb2i_idl_delete_key ( idl_store( be, db, key, idl ); } + bdb2i_idl_free( idl ); return 0; } /* We didn't find the ID. Hmmm... */ } + bdb2i_idl_free( idl ); return -1; } @@ -758,12 +758,16 @@ bdb2i_idl_delete_key ( else idl_store( be, db, key, idl ); } + bdb2i_idl_free( tmp ); free( kstr ); + bdb2i_idl_free( idl ); return 0; } } + bdb2i_idl_free( tmp ); } free( kstr ); + bdb2i_idl_free( idl ); return -1; }