[gobject-introspection] scannerlexer: Fix bad unref



commit 8c6978ed79fc0dfc2cef0b9dd61a7bdfcd12cfdf
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Dec 17 00:10:10 2013 -0500

    scannerlexer: Fix bad unref
    
    It's possible for scanner->current_file to be NULL, so add a check...

 giscanner/scannerlexer.l |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l
index 413bd98..b594362 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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]