]> git.sur5r.net Git - openldap/commitdiff
ITS#2348, additional check to prevent re-inserting IDs that are
authorHoward Chu <hyc@openldap.org>
Wed, 12 Mar 2003 10:45:00 +0000 (10:45 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 12 Mar 2003 10:45:00 +0000 (10:45 +0000)
already present. Hopefully the final fix...

servers/slapd/back-ldbm/idl.c

index 79f55a6ffbf8e5d0af7a90d5ed62e77be592320b..fcfeebcf18199b8d4c5429ee047ca54c586a7969 100644 (file)
@@ -560,6 +560,11 @@ idl_insert_key(
        if (ID_BLOCK_ID(idl, i) < id)
                i++;
 #endif
+       /* 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--;