summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h6
-rw-r--r--source3/lib/debug.c13
-rw-r--r--source3/nmbd/nmbd.c3
-rw-r--r--source3/param/loadparm.c12
-rw-r--r--source3/smbd/server.c1
-rw-r--r--source3/winbindd/winbindd.c3
6 files changed, 24 insertions, 14 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 579fc1b1f60..559a34ebb57 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 80b8310ab20..05e9eeeaad6 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 48e6d930545..2a7b28d97d3 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 28ffc08d498..8c1cf0973b0 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 201e301c1f0..63a9869dcef 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 034e43be049..0550da87d29 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