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:
Vit Rosin 2010-03-31 14:24:38 +04:00 committed by Andrew Borodin
parent 7ada01bfa1
commit 2eb870c9c9

View File

@ -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);
}
}
}