[glib] glib-compile-resources: Fix leak of a GHashTable



commit b0cbd21b25a416da039eae6d6685e51cae66444f
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Sep 25 15:25:17 2017 +0100

    glib-compile-resources: Fix leak of a GHashTable
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788138

 gio/glib-compile-resources.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gio/glib-compile-resources.c b/gio/glib-compile-resources.c
index a92fefd..8a1a07d 100644
--- a/gio/glib-compile-resources.c
+++ b/gio/glib-compile-resources.c
@@ -789,6 +789,7 @@ main (int argc, char **argv)
     {
       g_free (target);
       g_free (c_name);
+      g_hash_table_unref (files);
       return 1;
     }
 
@@ -858,6 +859,7 @@ main (int argc, char **argv)
               g_string_free (dep_string, TRUE);
               g_free (dependency_file);
               g_error_free (error);
+              g_hash_table_unref (files);
               return 1;
             }
         }
@@ -890,6 +892,7 @@ main (int argc, char **argv)
            {
              g_printerr ("Can't open temp file\n");
              g_free (c_name);
+              g_hash_table_unref (files);
              return 1;
            }
          close (fd);
@@ -936,6 +939,7 @@ main (int argc, char **argv)
       g_printerr ("%s\n", error->message);
       g_free (target);
       g_free (c_name);
+      g_hash_table_unref (files);
       return 1;
     }
 
@@ -948,6 +952,7 @@ main (int argc, char **argv)
        {
          g_printerr ("can't write to file %s", target);
          g_free (c_name);
+          g_hash_table_unref (files);
          return 1;
        }
 
@@ -985,6 +990,7 @@ main (int argc, char **argv)
        {
          g_printerr ("can't read back temporary file");
          g_free (c_name);
+          g_hash_table_unref (files);
          return 1;
        }
       g_unlink (binary_target);
@@ -994,6 +1000,7 @@ main (int argc, char **argv)
        {
          g_printerr ("can't write to file %s", target);
          g_free (c_name);
+          g_hash_table_unref (files);
          return 1;
        }
 
@@ -1090,6 +1097,7 @@ main (int argc, char **argv)
   g_hash_table_destroy (table);
   g_free (xmllint);
   g_free (c_name);
+  g_hash_table_unref (files);
 
   return 0;
 }


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