[grilo-plugins] lua-factory: Fix double-free when lua script fails to init



commit ff3b2adc4b33b9b083862b431995cd9a418c534c
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Mar 6 19:39:36 2015 +0100

    lua-factory: Fix double-free when lua script fails to init
    
    If we fail to initialise the script after having associated the resource
    with the source object, we might try to free that resource both when the
    source got disposed, and in the error path.

 src/lua-factory/grl-lua-factory.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/lua-factory/grl-lua-factory.c b/src/lua-factory/grl-lua-factory.c
index a0629f4..ad1532e 100644
--- a/src/lua-factory/grl-lua-factory.c
+++ b/src/lua-factory/grl-lua-factory.c
@@ -286,6 +286,7 @@ grl_lua_factory_source_new (gchar *lua_plugin_path,
   g_clear_object (&source_icon);
 
   g_object_set_data_full (G_OBJECT (source), "resources", resource, (GDestroyNotify) g_resource_unref);
+  resource = NULL;
 
   ret = lua_plugin_source_operations (L, source->priv->fn);
   if (ret != LUA_OK)


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