]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/dn2id.c
plug leaks
[openldap] / servers / slapd / back-bdb / dn2id.c
index 311fb30f1934b80041f743b288d1b3ee03671695..64231082728892978f1ab39b0e5dfe2c6651b834 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2005 The OpenLDAP Foundation.
+ * Copyright 2000-2006 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -178,7 +178,7 @@ bdb_dn2id_delete(
 #endif
        {
                buf[0] = DN_SUBTREE_PREFIX;
-               rc = db->del( db, txn, &key, 0 );
+               rc = bdb_idl_delete_key( op->o_bd, db, txn, &key, e->e_id );
                if( rc != 0 ) {
                        Debug( LDAP_DEBUG_ANY,
                        "=> bdb_dn2id_delete: subtree (%s) delete failed: %d\n",
@@ -1006,7 +1006,7 @@ synced:
 
        if ( !BDB_IDL_IS_RANGE( cx->tmp ) && cx->tmp[0] > 3 )
                bdb_idl_sort( cx->tmp, cx->buf );
-       if ( cx->bdb->bi_idl_cache_max_size ) {
+       if ( cx->bdb->bi_idl_cache_max_size && !BDB_IDL_IS_ZERO( cx->tmp )) {
                char *ptr = ((char *)&cx->id)-1;
                cx->key.data = ptr;
                cx->key.size = sizeof(ID)+1;