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,6 +67,7 @@ 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);
|
||||
if (logfilename != NULL) {
|
||||
f = fopen (logfilename, "a");
|
||||
if (f != NULL) {
|
||||
(void)vfprintf(f, fmt, args);
|
||||
@ -75,4 +76,5 @@ mc_log(const char *fmt, ...)
|
||||
g_free(logfilename);
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user