[dia] Catch a double free



commit 55c8e61fe1cc4d5a6e86973e9a96633c0092fdeb
Author: Zander Brown <zbrown gnome org>
Date:   Fri May 24 14:45:38 2019 +0100

    Catch a double free

 lib/dia_dirs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/lib/dia_dirs.c b/lib/dia_dirs.c
index 9f009d0e..0a8fbb9f 100644
--- a/lib/dia_dirs.c
+++ b/lib/dia_dirs.c
@@ -103,9 +103,10 @@ dia_get_data_directory(const gchar* subdir)
   g_free (sLoc);
   return returnPath;
 #else
-  gchar *base = PKGDATADIR;
+  gchar *base = g_strdup (PKGDATADIR);
   char  *ret;
   if (g_getenv ("DIA_BASE_PATH") != NULL) {
+    g_free (base);
     /* a small hack cause the final destination and the local path differ */
     base = g_build_filename (g_getenv ("DIA_BASE_PATH"), "data", NULL);
   }


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