The Samba-Bugzilla – Attachment 7618 Details for
Bug 8970
Possible memory leaks in the samba master process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Latest git-am fix for 3.5.next
0001-Fix-bug-8970-Possible-memory-leaks-in-the-samba-mast.patch (text/plain), 5.07 KB, created by
Jeremy Allison
on 2012-06-01 18:06:02 UTC
(
hide
)
Description:
Latest git-am fix for 3.5.next
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2012-06-01 18:06:02 UTC
Size:
5.07 KB
patch
obsolete
>From a632dffffc3c4d8fb07622c1203c5f25526db2e3 Mon Sep 17 00:00:00 2001 >From: Richard Sharpe <realrichardsharpe@gmail.com> >Date: Thu, 31 May 2012 15:43:14 -0700 >Subject: [PATCH] Fix bug #8970 - Possible memory leaks in the samba master > process. > >Signed-off-by: Jeremy Allison <jra@samba.org> >--- > source3/include/proto.h | 6 +++--- > source3/lib/debug.c | 13 ++++++++----- > source3/nmbd/nmbd.c | 3 ++- > source3/param/loadparm.c | 12 ++++++++---- > source3/smbd/server.c | 1 + > source3/winbindd/winbindd.c | 3 ++- > 6 files changed, 24 insertions(+), 14 deletions(-) > >diff --git a/source3/include/proto.h b/source3/include/proto.h >index 579fc1b..559a34e 100644 >--- a/source3/include/proto.h >+++ b/source3/include/proto.h >@@ -3918,9 +3918,9 @@ void expire_workgroups_and_servers(time_t t); > /* 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/lib/debug.c b/source3/lib/debug.c >index 80b8310..05e9eee 100644 >--- a/source3/lib/debug.c >+++ b/source3/lib/debug.c >@@ -657,9 +657,11 @@ bool reopen_logs( void ) > SAFE_FREE(fname); > fname = SMB_STRDUP(logfname); > if (!fname) { >+ TALLOC_FREE(logfname); > return false; > } > } >+ TALLOC_FREE(logfname); > } > > debugf = fname; >@@ -1028,6 +1030,8 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) > */ > if( lp_timestamp_logs() || lp_debug_prefix_timestamp() || !(lp_loaded()) ) { > char header_str[200]; >+ char *curtime = current_timestring(talloc_tos(), >+ lp_debug_hires_timestamp()); > > header_str[0] = '\0'; > >@@ -1050,19 +1054,18 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) > ", class=%s", > default_classname_table[cls]); > } >- >+ > /* Print it all out at once to prevent split syslog output. */ > if( lp_debug_prefix_timestamp() ) { > (void)Debug1( "[%s, %2d%s] ", >- current_timestring(talloc_tos(), >- lp_debug_hires_timestamp()), >+ curtime, > level, header_str); > } else { > (void)Debug1( "[%s, %2d%s] %s(%s)\n", >- current_timestring(talloc_tos(), >- lp_debug_hires_timestamp()), >+ curtime, > level, header_str, location, func ); > } >+ TALLOC_FREE(curtime); > } > > errno = old_errno; >diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c >index 48e6d93..2a7b28d 100644 >--- a/source3/nmbd/nmbd.c >+++ b/source3/nmbd/nmbd.c >@@ -366,11 +366,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 28ffc08..8c1cf09 100644 >--- a/source3/param/loadparm.c >+++ b/source3/param/loadparm.c >@@ -5318,9 +5318,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) >@@ -9283,7 +9283,11 @@ 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/smbd/server.c b/source3/smbd/server.c >index 201e301..63a9869 100644 >--- a/source3/smbd/server.c >+++ b/source3/smbd/server.c >@@ -804,6 +804,7 @@ bool reload_services(bool test) > set_dyn_CONFIGFILE(fname); > test = False; > } >+ TALLOC_FREE(fname); > } > > reopen_logs(); >diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c >index 034e43b..0550da8 100644 >--- a/source3/winbindd/winbindd.c >+++ b/source3/winbindd/winbindd.c >@@ -67,11 +67,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 >-- >1.7.7.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
Actions:
View
Attachments on
bug 8970
:
7614
|
7615
|
7616
|
7617
| 7618