summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-03-06 19:39:36 +0100
committerBastien Nocera <hadess@hadess.net>2015-03-06 19:39:36 +0100
commitff3b2adc4b33b9b083862b431995cd9a418c534c (patch)
tree10e18ec0121f105294e31efe7f784175455dc46e /src
parent85a684b6d2bb9baeaff14220ed0b3a1a12a7ab32 (diff)
downloadgrilo-plugins-ff3b2adc4b33b9b083862b431995cd9a418c534c.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/lua-factory/grl-lua-factory.c1
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)