[gobject-introspection] girepository: Fix some memory leaks in gdump.c
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gobject-introspection] girepository: Fix some memory leaks in gdump.c
- Date: Fri, 26 Feb 2016 08:22:15 +0000 (UTC)
commit 1746e1dc4604e3498c4b9f45dfa5c85f0fa2440d
Author: Philip Withnall <philip tecnocode co uk>
Date: Wed Feb 24 23:53:08 2016 +0000
girepository: Fix some memory leaks in gdump.c
These were leaking memory when dumping introspection data from projects
for building their GIR files. That’s generally not a problem, unless
you’re trying to build the project with -fsanitize=address, which causes
the GIR build phase to error out due to leaking memory.
https://bugzilla.gnome.org/show_bug.cgi?id=762653
girepository/gdump.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/girepository/gdump.c b/girepository/gdump.c
index a72841f..b60a5dc 100644
--- a/girepository/gdump.c
+++ b/girepository/gdump.c
@@ -204,6 +204,7 @@ dump_signals (GType type, GOutputStream *out)
}
goutput_write (out, " </signal>\n");
}
+ g_free (sig_ids);
}
static void
@@ -249,6 +250,8 @@ dump_object_type (GType type, const char *symbol, GOutputStream *out)
escaped_printf (out, " <implements name=\"%s\"/>\n",
g_type_name (itype));
}
+ g_free (interfaces);
+
dump_properties (type, out);
dump_signals (type, out);
goutput_write (out, " </class>\n");
@@ -280,6 +283,8 @@ dump_interface_type (GType type, const char *symbol, GOutputStream *out)
escaped_printf (out, " <prerequisite name=\"%s\"/>\n",
g_type_name (itype));
}
+ g_free (interfaces);
+
dump_properties (type, out);
dump_signals (type, out);
goutput_write (out, " </interface>\n");
@@ -379,6 +384,7 @@ dump_fundamental_type (GType type, const char *symbol, GOutputStream *out)
escaped_printf (out, " <implements name=\"%s\"/>\n",
g_type_name (itype));
}
+ g_free (interfaces);
goutput_write (out, " </fundamental>\n");
}
@@ -471,6 +477,8 @@ g_irepository_dump (const char *arg, GError **error)
input_file = g_file_new_for_path (args[0]);
output_file = g_file_new_for_path (args[1]);
+ g_strfreev (args);
+
input = g_file_read (input_file, NULL, error);
if (input == NULL)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]