From: Howard Chu Date: Wed, 12 Mar 2003 11:10:35 +0000 (+0000) Subject: ITS#2348 additional check from HEAD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e5870cd4783e40e0b8d70bb9c100c8990060733;p=thirdparty%2Fopenldap.git ITS#2348 additional check from HEAD --- diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index 0b5a81baf6..64c1cc7087 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -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--;