1
0
Fork 0

less strdup()+free()

Improvement of f8ff93234e

Signed-off-by: Steffen Jaeckel <jaeckel-floss@eyet-services.de>
This commit is contained in:
Steffen Jaeckel 2022-08-19 10:30:16 +02:00
parent 095d40d3bd
commit 25e56fb494
1 changed files with 3 additions and 6 deletions

View File

@ -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*