The branch, v3-5-test has been updated
       via  d853bc0 Fix bug #8970 - Possible memory leaks in the samba master 
process.
      from  0529cf9 Fix bug #8882 - Broken processing of %U with vfs_full_audit 
when force user is set.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit d853bc02c32a4c1172bf5f3f64c75db5ecc5ccca
Author: Richard Sharpe <[email protected]>
Date:   Thu May 31 15:43:14 2012 -0700

    Fix bug #8970 - Possible memory leaks in the samba master process.
    
    Signed-off-by: Jeremy Allison <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 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(-)


Changeset truncated at 500 lines:

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


-- 
Samba Shared Repository

Reply via email to