[SCM] Samba Shared Repository - branch v3-6-test updated
Karolin Seeger
kseeger at samba.org
Wed Jun 13 11:31:54 MDT 2012
The branch, v3-6-test has been updated
via ec7a5f2 Forward port of Richard Sharpe's <realrichardsharpe at gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.
from 7ca2654 s3: fix compile of krb5 locator on Solaris
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit ec7a5f2593b67797fc3924611d3b0b05b807d0bf
Author: Jeremy Allison <jra at samba.org>
Date: Thu May 31 16:25:52 2012 -0700
Forward port of Richard Sharpe's <realrichardsharpe at gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.
-----------------------------------------------------------------------
Summary of changes:
source3/include/proto.h | 6 +++---
source3/nmbd/nmbd.c | 3 ++-
source3/param/loadparm.c | 12 ++++++++----
source3/printing/load.c | 7 ++++++-
source3/smbd/server_reload.c | 1 +
source3/winbindd/winbindd.c | 3 ++-
6 files changed, 22 insertions(+), 10 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 28b58b2..e22fc9c 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1338,9 +1338,9 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m
/* The following definitions come from param/loadparm.c */
char *lp_smb_ports(void);
-char *lp_dos_charset(void);
-char *lp_unix_charset(void);
-char *lp_display_charset(void);
+const char *lp_dos_charset(void);
+const char *lp_unix_charset(void);
+const char *lp_display_charset(void);
char *lp_logfile(void);
char *lp_configfile(void);
char *lp_smb_passwd_file(void);
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 986c575..0172e08 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -365,11 +365,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() )
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 6ad2452..dd63339 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -5575,9 +5575,9 @@ static char *lp_string(const char *s)
char fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);}
FN_GLOBAL_STRING(lp_smb_ports, &Globals.smb_ports)
-FN_GLOBAL_STRING(lp_dos_charset, &Globals.dos_charset)
-FN_GLOBAL_STRING(lp_unix_charset, &Globals.unix_charset)
-FN_GLOBAL_STRING(lp_display_charset, &Globals.display_charset)
+FN_GLOBAL_CONST_STRING(lp_dos_charset, &Globals.dos_charset)
+FN_GLOBAL_CONST_STRING(lp_unix_charset, &Globals.unix_charset)
+FN_GLOBAL_CONST_STRING(lp_display_charset, &Globals.display_charset)
FN_GLOBAL_STRING(lp_logfile, &Globals.szLogFile)
FN_GLOBAL_STRING(lp_configfile, &Globals.szConfigFile)
FN_GLOBAL_STRING(lp_smb_passwd_file, &Globals.szSMBPasswdFile)
@@ -9647,7 +9647,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$
diff --git a/source3/printing/load.c b/source3/printing/load.c
index 5acc258..829c3e3 100644
--- a/source3/printing/load.c
+++ b/source3/printing/load.c
@@ -30,6 +30,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))
@@ -38,8 +39,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)) {
diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c
index 6e0ab39..fd6dc1a 100644
--- a/source3/smbd/server_reload.c
+++ b/source3/smbd/server_reload.c
@@ -127,6 +127,7 @@ bool reload_services(struct messaging_context *msg_ctx, int smb_sock,
set_dyn_CONFIGFILE(fname);
test = False;
}
+ TALLOC_FREE(fname);
}
reopen_logs();
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 110f034..f80949d 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -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
--
Samba Shared Repository
More information about the samba-cvs
mailing list