[gdk-pixbuf] queryloaders: do not leak moduledir on windows



commit a2523b48d9f1e47e1be8b17dd6f0f9eddf3202d9
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Fri Jan 5 16:50:15 2018 +0100

    queryloaders: do not leak moduledir on windows

 gdk-pixbuf/queryloaders.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
index 085ef7c..9c17624 100644
--- a/gdk-pixbuf/queryloaders.c
+++ b/gdk-pixbuf/queryloaders.c
@@ -344,8 +344,13 @@ int main (int argc, char **argv)
 
                 moduledir = g_strdup (g_getenv ("GDK_PIXBUF_MODULEDIR"));
 #ifdef G_OS_WIN32
-                if (moduledir != NULL && *moduledir != '\0')
-                        moduledir = g_locale_to_utf8 (moduledir, -1, NULL, NULL, NULL);
+                if (moduledir != NULL && *moduledir != '\0') {
+                        gchar *path;
+
+                        path = g_locale_to_utf8 (moduledir, -1, NULL, NULL, NULL);
+                        g_free (moduledir);
+                        moduledir = path;
+                }
 #endif
                 if (moduledir == NULL || *moduledir == '\0') {
                         g_free (moduledir);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]