Commit 43359bb0 authored by Howard Chu's avatar Howard Chu
Browse files

Don't leak logfiles

parent e63ac9ac
......@@ -77,6 +77,7 @@ typedef struct {
static CfBackInfo cfBackInfo;
static char *passwd_salt;
static FILE *logfile;
static char *logfileName;
#ifdef SLAP_AUTH_REWRITE
static BerVarray authz_rewrites;
......@@ -1124,6 +1125,10 @@ config_generic(ConfigArgs *c) {
case CFG_LOGFILE:
ch_free( logfileName );
logfileName = NULL;
if ( logfile ) {
fclose( logfile );
logfile = NULL;
}
break;
case CFG_SERVERID: {
......@@ -1683,7 +1688,6 @@ sortval_reject:
}
break;
case CFG_LOGFILE: {
FILE *logfile;
if ( logfileName ) ch_free( logfileName );
logfileName = c->value_string;
logfile = fopen(logfileName, "w");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment