]> git.sur5r.net Git - openldap/commitdiff
ITS#2348 additional check from HEAD
authorHoward Chu <hyc@openldap.org>
Wed, 12 Mar 2003 11:10:35 +0000 (11:10 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 12 Mar 2003 11:10:35 +0000 (11:10 +0000)
servers/slapd/back-ldbm/idl.c

index 0b5a81baf6aee0b95f018dfbfca9fee45d718956..64c1cc7087bc9fd97bf7e61b33655819d52c0a37 100644 (file)
@@ -480,6 +480,12 @@ idl_insert_key(
        /* select the block to try inserting into *//* XXX linear search XXX */
        for ( i = 0; !ID_BLOCK_NOID(idl, i) && id > ID_BLOCK_ID(idl, i); i++ )
                ;       /* NULL */
+       
+       /* The ID already exists in the IDL, no insert needed */
+       if ( ID_BLOCK_ID( idl, i ) == id ) {
+               idl_free( idl );
+               return 0;
+       }
 
        if ( i != 0 ) {
                i--;