diff options
author | Ignacio Casal Quinteiro <qignacio@amazon.com> | 2018-01-05 16:50:15 +0100 |
---|---|---|
committer | Ignacio Casal Quinteiro <qignacio@amazon.com> | 2018-01-12 08:50:15 +0100 |
commit | a2523b48d9f1e47e1be8b17dd6f0f9eddf3202d9 (patch) | |
tree | 7bf648fe76ac5822bd2799f260f01fd42087e7de | |
parent | 971b09fcd8f1ff5e1c4df0772feab2371bbcdced (diff) | |
download | gdk-pixbuf-a2523b48d9f1e47e1be8b17dd6f0f9eddf3202d9.tar.gz |
queryloaders: do not leak moduledir on windows
-rw-r--r-- | 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 085ef7c8c..9c17624df 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); |