summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-12-17 00:10:10 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-12-17 00:10:10 -0500
commit8c6978ed79fc0dfc2cef0b9dd61a7bdfcd12cfdf (patch)
tree769e0689dd307972c8352d11d815ddfd33e4c136
parentc1f22aa7ee718217b465d362235948272a09d677 (diff)
downloadgobject-introspection-8c6978ed79fc0dfc2cef0b9dd61a7bdfcd12cfdf.tar.gz
scannerlexer: Fix bad unref
It's possible for scanner->current_file to be NULL, so add a check...
-rw-r--r--giscanner/scannerlexer.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 413bd98a..b594362b 100644
--- a/giscanner/scannerlexer.l
+++ b/giscanner/scannerlexer.l
@@ -400,7 +400,8 @@ process_linemarks (GISourceScanner *scanner)
filename = real;
}
- g_object_unref (scanner->current_file);
+ if (scanner->current_file)
+ g_object_unref (scanner->current_file);
scanner->current_file = g_file_new_for_path (filename);
g_free (filename);
}