]> git.sur5r.net Git - openldap/commitdiff
More fixes for prev commit
authorHoward Chu <hyc@openldap.org>
Wed, 18 Aug 2004 15:23:37 +0000 (15:23 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Aug 2004 15:23:37 +0000 (15:23 +0000)
servers/slapd/backend.c

index 2599fce7a79131edce6b104047958367d0a4433c..768a2e340e2e91399655741c4d35a58f6090928c 100644 (file)
@@ -626,12 +626,22 @@ backend_db_init(
                return NULL;
        }
 
+       be = backendDB;
+
        backendDB = (BackendDB *) ch_realloc(
                        (char *) backendDB,
                    (nBackendDB + 1) * sizeof(Backend) );
 
        memset( &backendDB[nbackends], '\0', sizeof(Backend) );
 
+       /* did realloc move our table? if so, fix up dependent pointers */
+       if ( be != backendDB ) {
+               int i;
+               for ( i=0, be=backendDB; i<nbackends; i++, be++ ) {
+                       be->be_pcl_mutexp = &be->be_pcl_mutex;
+               }
+       }
+
        be = &backends[nbackends++];
 
        be->bd_info = bi;