Merge pull request #3796 from ntherning/windows-backend-for-MemoryMappedFile
[mono.git] / eglib / src / goutput.c
index 689493be845202536b599be5f4d646a602ca8db5..2dcf8746e08a90a3d3f506d7a19849b93db60295 100644 (file)
@@ -31,8 +31,6 @@
 #include <stdlib.h>
 #include <glib.h>
 
-#include "vasprintf.h"
-
 /* The current fatal levels, error is always fatal */
 static GLogLevelFlags fatal = G_LOG_LEVEL_ERROR;
 static GLogFunc default_log_func;
@@ -49,8 +47,10 @@ g_print (const gchar *format, ...)
        va_list args;
 
        va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0)
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
                return;
+       }
        va_end (args);
 
        if (!stdout_handler)
@@ -67,8 +67,10 @@ g_printerr (const gchar *format, ...)
        va_list args;
 
        va_start (args, format);
-       if (g_vasprintf (&msg, format, args) < 0)
+       if (g_vasprintf (&msg, format, args) < 0) {
+               va_end (args);
                return;
+       }
        va_end (args);
 
        if (!stderr_handler)