[seed] Fixing some leaks



commit a12161e82b860264c668f61de2431737420fe1da
Author: Danilo Cesar Lemes de Paula <danilo cesar collabora co uk>
Date:   Thu Jan 28 14:52:17 2016 -0200

    Fixing some leaks

 libseed/seed-engine.c   |    2 +-
 libseed/seed-importer.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index b884223..b010938 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -1053,7 +1053,7 @@ seed_gobject_add_methods_for_interfaces (JSContextRef ctx,
          seed_gobject_define_property_from_function_info
            (ctx, function, object, TRUE);
        }
-      // g_base_info_unref((GIBaseInfo*)interface);
+      g_base_info_unref((GIBaseInfo*)interface);
     }
 }
 
diff --git a/libseed/seed-importer.c b/libseed/seed-importer.c
index 5ed42fc..5d4c161 100644
--- a/libseed/seed-importer.c
+++ b/libseed/seed-importer.c
@@ -419,6 +419,7 @@ seed_gi_importer_handle_constant (JSContextRef ctx,
                            constant_value);
 
   g_base_info_unref ((GIBaseInfo *) constant_type);
+  g_constant_info_free_value(info, &argument);
 }
 
 static gchar *
@@ -645,7 +646,9 @@ seed_importer_get_search_path (JSContextRef ctx, JSValueRef * exception)
       entry = seed_value_to_string (ctx, entry_ref, exception);
 
       if (g_file_test (entry, G_FILE_TEST_EXISTS) == TRUE)
-        path = g_slist_append (path, entry);
+          path = g_slist_append (path, entry);
+      else
+          g_free(entry);
     }
 
   return path;
@@ -832,6 +835,7 @@ static JSObjectRef seed_importer_try_load (JSContextRef ctx,
         g_free (file_path);
         return ret;
     }
+    g_free (file_path);
 
     // check if prop is file ending with '.js'
     file_path = g_build_filename (test_path, prop_as_js, NULL);
@@ -840,6 +844,7 @@ static JSObjectRef seed_importer_try_load (JSContextRef ctx,
         g_free (file_path);
         return ret;
     }
+    g_free (file_path);
 
     // check if file is native module
     file_path = g_build_filename (test_path, prop_as_lib, NULL);
@@ -848,6 +853,8 @@ static JSObjectRef seed_importer_try_load (JSContextRef ctx,
         g_free (file_path);
         return ret;
     }
+    g_free (file_path);
+
     return ret;
 }
 


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