summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2016-04-22 13:23:51 +0200
committerColin Walters <walters@verbum.org>2016-05-08 15:35:13 -0400
commit9f1f2f5efd008aba9e92edd3a44d431b84fa5174 (patch)
treedff8e4ccc598a54e0eb87de499a3eb3e947ca82e
parentbd475c00d96235d8f4a0a02006de378d10f5f9b3 (diff)
downloadgobject-introspection-9f1f2f5efd008aba9e92edd3a44d431b84fa5174.tar.gz
gdump: do not leak gfile objects
-rw-r--r--girepository/gdump.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/girepository/gdump.c b/girepository/gdump.c
index b60a5dce..6aa8bfd1 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -480,10 +480,17 @@ g_irepository_dump (const char *arg, GError **error)
g_strfreev (args);
input = g_file_read (input_file, NULL, error);
+ g_object_unref (input_file);
+
if (input == NULL)
- return FALSE;
+ {
+ g_object_unref (output_file);
+ return FALSE;
+ }
output = g_file_replace (output_file, NULL, FALSE, 0, NULL, error);
+ g_object_unref (output_file);
+
if (output == NULL)
{
g_input_stream_close (G_INPUT_STREAM (input), NULL, NULL);