1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

r1224: Fix longstanding memleak bug with logfile name being set before lp_load()

loads the initial config file and overwrites the written logfile name with
zeros in init_globals(). Ensure we do a string_free() on Globals.szLogFile
if it isn't NULL.
Jeremy.
This commit is contained in:
Jeremy Allison 2004-06-23 01:51:45 +00:00 committed by Gerald (Jerry) Carter
parent 5a1d8c3c9b
commit c378f3c325

View File

@ -1293,6 +1293,13 @@ static void init_globals(void)
if (!done_init) {
int i;
/* The logfile can be set before this is invoked. Free it if so. */
if (Globals.szLogFile != NULL) {
string_free(&Globals.szLogFile);
Globals.szLogFile = NULL;
}
memset((void *)&Globals, '\0', sizeof(Globals));
for (i = 0; parm_table[i].label; i++)