summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid King <dking@redhat.com>2021-05-20 11:37:56 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2021-06-18 14:28:05 +0000
commit9bef18a7005926986fbaa7c103f126c49901fe34 (patch)
tree9f20dce2bfb33096a51b3cdf184d86d1f2362c23
parent91ce47665818eae63d3f32185dd6c18d5a9a0b34 (diff)
downloadgobject-introspection-9bef18a7005926986fbaa7c103f126c49901fe34.tar.gz
girepository: Fix leak in _g_ir_parser_parse_file
Found by Coverity. https://bugzilla.redhat.com/show_bug.cgi?id=1938731
-rw-r--r--girepository/girparser.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index ad676e33..f62b1de6 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -3672,7 +3672,11 @@ _g_ir_parser_parse_file (GIrParser *parser,
*dash = '\0';
if (!g_file_get_contents (filename, &buffer, &length, error))
- return NULL;
+ {
+ g_free (namespace);
+
+ return NULL;
+ }
module = _g_ir_parser_parse_string (parser, namespace, filename, buffer, length, error);