From 1790f1a21583d94c24aeb9549053e426dbdebb40 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Mon, 22 Jan 2024 16:18:57 +0100 Subject: Take errors occurring while creating scan contexts into account. --- src/rost.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rost.c b/src/rost.c index 297320d..d397a2c 100644 --- a/src/rost.c +++ b/src/rost.c @@ -504,6 +504,7 @@ int main(int argc, char **argv) if (content == NULL) goto bad_file_content; context = g_content_scanner_analyze(scanner, options, content); + if (context == NULL) goto bad_scan_context; if (g_scan_options_get_print_json(options)) { @@ -522,6 +523,9 @@ int main(int argc, char **argv) } g_object_unref(G_OBJECT(context)); + + bad_scan_context: + g_object_unref(G_OBJECT(content)); bad_file_content: -- cgit v0.11.2-87-g4458