summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-06-21 16:30:17 -0700
committerPavel Roskin <plroskin@gmail.com>2016-07-08 04:27:07 +0000
commit951e6327576988251a9a479494e20d605efaad71 (patch)
treed85c703e652ca84a03d13d36228c2df3c9ab9329
parentb00ca6e03d856398624b9f2b2cc19f2ab867aa66 (diff)
downloadxrdp-proprietary-951e6327576988251a9a479494e20d605efaad71.tar.gz
xrdp-proprietary-951e6327576988251a9a479494e20d605efaad71.zip
Make program_name constant, don't duplicate or free it
-rw-r--r--common/log.c10
-rw-r--r--common/log.h2
-rw-r--r--sesman/tools/sesadmin.c2
-rw-r--r--sesman/tools/sestest.c2
4 files changed, 5 insertions, 11 deletions
diff --git a/common/log.c b/common/log.c
index 54f625d7..1338287a 100644
--- a/common/log.c
+++ b/common/log.c
@@ -212,12 +212,6 @@ internal_log_end(struct log_config *l_cfg)
l_cfg->log_file = 0;
}
- if (0 != l_cfg->program_name)
- {
- g_free(l_cfg->program_name);
- l_cfg->program_name = 0;
- }
-
ret = LOG_STARTUP_OK;
return ret;
}
@@ -336,7 +330,7 @@ internal_config_read_logging(int file, struct log_config *lc,
list_clear(param_n);
/* setting defaults */
- lc->program_name = g_strdup(applicationName);
+ lc->program_name = applicationName;
lc->log_file = 0;
lc->fd = 0;
lc->log_level = LOG_LEVEL_DEBUG;
@@ -455,7 +449,7 @@ log_start_from_param(const struct log_config *iniParams)
g_staticLogConfig->log_level = iniParams->log_level;
g_staticLogConfig->log_lock = iniParams->log_lock;
g_staticLogConfig->log_lock_attr = iniParams->log_lock_attr;
- g_staticLogConfig->program_name = g_strdup(iniParams->program_name);
+ g_staticLogConfig->program_name = iniParams->program_name;
g_staticLogConfig->syslog_level = iniParams->syslog_level;
ret = internal_log_start(g_staticLogConfig);
diff --git a/common/log.h b/common/log.h
index 6654028b..b90ac660 100644
--- a/common/log.h
+++ b/common/log.h
@@ -65,7 +65,7 @@ enum logReturns
struct log_config
{
- char *program_name;
+ const char *program_name;
char *log_file;
int fd;
unsigned int log_level;
diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c
index 3ee230a5..98f727e6 100644
--- a/sesman/tools/sesadmin.c
+++ b/sesman/tools/sesadmin.c
@@ -59,7 +59,7 @@ int main(int argc, char **argv)
serv[0] = '\0';
port[0] = '\0';
- logging.program_name = g_strdup("sesadmin");
+ logging.program_name = "sesadmin";
logging.log_file = g_strdup("xrdp-sesadmin.log");
logging.log_level = LOG_LEVEL_DEBUG;
logging.enable_syslog = 0;
diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c
index 0653355c..17795dfc 100644
--- a/sesman/tools/sestest.c
+++ b/sesman/tools/sestest.c
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
log.enable_syslog = 0;
log.log_level = 99;
- log.program_name = g_strdup("sestest");
+ log.program_name = "sestest";
log.log_file = g_strdup("sestest.log");
log_start_from_param(&log);
scp_init();