1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.

This commit is contained in:
Jeremy Allison 2012-05-31 15:06:58 -07:00
parent f6e41026f8
commit 8fd02fa2d6
5 changed files with 16 additions and 4 deletions

View File

@ -382,11 +382,12 @@ static bool reload_nmbd_services(bool test)
set_remote_machine_name("nmbd", False);
if ( lp_loaded() ) {
const char *fname = lp_configfile();
char *fname = lp_configfile();
if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
test = False;
}
TALLOC_FREE(fname);
}
if ( test && !lp_file_list_changed() )

View File

@ -8809,7 +8809,11 @@ static bool lp_load_ex(const char *pszFname,
}
}
lp_add_auto_services(lp_auto_services());
{
char *serv = lp_auto_services();
lp_add_auto_services(serv);
TALLOC_FREE(serv);
}
if (add_ipc) {
/* When 'restrict anonymous = 2' guest connections to ipc$

View File

@ -31,6 +31,7 @@ static void add_auto_printers(void)
int pnum = lp_servicenumber(PRINTERS_NAME);
char *str;
char *saveptr;
char *auto_serv = NULL;
if (pnum < 0)
if (process_registry_service(PRINTERS_NAME))
@ -39,8 +40,12 @@ static void add_auto_printers(void)
if (pnum < 0)
return;
if ((str = SMB_STRDUP(lp_auto_services())) == NULL)
auto_serv = lp_auto_services();
str = SMB_STRDUP(auto_serv);
TALLOC_FREE(auto_serv);
if (str == NULL) {
return;
}
for (p = strtok_r(str, LIST_SEP, &saveptr); p;
p = strtok_r(NULL, LIST_SEP, &saveptr)) {

View File

@ -146,6 +146,7 @@ bool reload_services(struct smbd_server_connection *sconn,
set_dyn_CONFIGFILE(fname);
test = False;
}
TALLOC_FREE(fname);
}
reopen_logs();

View File

@ -65,11 +65,12 @@ static bool reload_services_file(const char *lfile)
bool ret;
if (lp_loaded()) {
const char *fname = lp_configfile();
char *fname = lp_configfile();
if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
set_dyn_CONFIGFILE(fname);
}
TALLOC_FREE(fname);
}
/* if this is a child, restore the logfile to the special