[gjs] importer: Fix GError leaks



commit 213644a436d25d13e99d673135715c32c1639e45
Author: Pavel Vasin <rat4vier gmail com>
Date:   Wed Nov 28 20:56:37 2012 +0400

    importer: Fix GError leaks
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689284

 gjs/importer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gjs/importer.c b/gjs/importer.c
index 0cb81a7..184f14c 100644
--- a/gjs/importer.c
+++ b/gjs/importer.c
@@ -345,6 +345,8 @@ load_module_init(JSContext  *context,
             !g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOTDIR) &&
             !g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
             gjs_throw_g_error(context, error);
+        else
+            g_error_free(error);
 
         return NULL;
     }
@@ -458,6 +460,8 @@ import_file(JSContext  *context,
             !g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOTDIR) &&
             !g_error_matches(error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
             gjs_throw_g_error(context, error);
+        else
+            g_error_free(error);
 
         goto out;
     }



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