summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: