mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #2041: check return value of g_strdup_printf() in mc_log().
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
7ada01bfa1
commit
2eb870c9c9
@ -67,12 +67,14 @@ mc_log(const char *fmt, ...)
|
||||
if (is_logging_enabled()) {
|
||||
va_start(args, fmt);
|
||||
logfilename = g_strdup_printf("%s/%s/log", home_dir, MC_USERCONF_DIR);
|
||||
f = fopen (logfilename, "a");
|
||||
if (f != NULL) {
|
||||
if (logfilename != NULL) {
|
||||
f = fopen (logfilename, "a");
|
||||
if (f != NULL) {
|
||||
(void)vfprintf(f, fmt, args);
|
||||
(void)fclose(f);
|
||||
}
|
||||
g_free(logfilename);
|
||||
va_end(args);
|
||||
}
|
||||
g_free(logfilename);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user