about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-08-19 10:30:16 +0200
committerSteffen Jaeckel <jaeckel-floss@eyet-services.de>2022-09-07 12:42:15 +0200
commit25e56fb494232ce061de2590a8734a29b7169e3f (patch)
tree82a86ffdcccde678a5c538b6d0fb3680db159f60
parent095d40d3bd70c4058ad13c0e7956b90a14c5b3f7 (diff)
downloadprofani-tty-25e56fb494232ce061de2590a8734a29b7169e3f.tar.gz
less strdup()+free()
Improvement of f8ff93234eb118de2e69d0c4667a6cbbe90e8f8c

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
-rw-r--r--src/log.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/log.c b/src/log.c
index b85f1005..df93dd15 100644
--- a/src/log.c
+++ b/src/log.c
@@ -180,13 +180,10 @@ log_init(log_level_t filter, char* log_file)
         user_provided_log = TRUE;
     }
 
-    gchar* lf = files_get_log_file(log_file);
+    mainlogfile = files_get_log_file(log_file);
 
-    logp = fopen(lf, "a");
-    g_chmod(lf, S_IRUSR | S_IWUSR);
-    mainlogfile = g_strdup(lf);
-
-    g_free(lf);
+    logp = fopen(mainlogfile, "a");
+    g_chmod(mainlogfile, S_IRUSR | S_IWUSR);
 }
 
 const char*