]> git.sur5r.net Git - openldap/commitdiff
strdup/free li->li_directory when chaning, so unmalloced version won't be freed
authorHallvard Furuseth <hallvard@openldap.org>
Sun, 4 Apr 1999 21:49:56 +0000 (21:49 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Sun, 4 Apr 1999 21:49:56 +0000 (21:49 +0000)
servers/slapd/back-ldbm/config.c
servers/slapd/back-ldbm/init.c

index 44a38c7bac628801cfc177ff3ab74cb0a2986d8f..ad3053e36cd588e3f71dd27f5e17a541eb7a7f0d 100644 (file)
@@ -35,6 +35,8 @@ ldbm_back_db_config(
                            fname, lineno );
                        return( 1 );
                }
+               if ( li->li_directory )
+                       free( li->li_directory );
                li->li_directory = ch_strdup( argv[1] );
 
                li->li_nextid_file =
index 8c46a6510dcddc76fe39f575c8b0ab577c19387e..b3c2845fa9ca63cb7319554137fcf2fd5e6106b1 100644 (file)
@@ -106,7 +106,7 @@ ldbm_back_db_init(
        li->li_mode = DEFAULT_MODE;
 
        /* default database directory */
-       li->li_directory = DEFAULT_DB_DIRECTORY;
+       li->li_directory = ch_strdup( DEFAULT_DB_DIRECTORY );
 
        /* always index dn, id2children, objectclass (used in some searches) */
        argv[ 0 ] = "dn";