summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2024-01-22 15:18:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2024-01-22 15:18:57 (GMT)
commit1790f1a21583d94c24aeb9549053e426dbdebb40 (patch)
treedbe519055ca7c0d74fb569ce8fbe25dcaed30e55 /src
parent0ff1e52622828663d01f98c97f2cd8eccb8facf8 (diff)
Take errors occurring while creating scan contexts into account.
Diffstat (limited to 'src')
-rw-r--r--src/rost.c4
1 files changed, 4 insertions, 0 deletions
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: