From db859cee369e07d0312169021f14b808f1c92bac Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 4 Apr 1999 21:49:56 +0000 Subject: [PATCH] strdup/free li->li_directory when chaning, so unmalloced version won't be freed --- servers/slapd/back-ldbm/config.c | 2 ++ servers/slapd/back-ldbm/init.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-ldbm/config.c b/servers/slapd/back-ldbm/config.c index 44a38c7bac..ad3053e36c 100644 --- a/servers/slapd/back-ldbm/config.c +++ b/servers/slapd/back-ldbm/config.c @@ -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 = diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index 8c46a6510d..b3c2845fa9 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -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"; -- 2.39.5