From a6999575d542b4d0aa42211abbeead2213fae54d Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 10 Jun 2009 12:02:23 +0300 Subject: [PATCH] plugin: fix leaks introduced by fix for #584389 --- gst/gstplugin.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/gstplugin.c b/gst/gstplugin.c index e3eea17761..b54f3d8f5b 100644 --- a/gst/gstplugin.c +++ b/gst/gstplugin.c @@ -596,10 +596,10 @@ gst_plugin_load_file (const gchar * filename, GError ** error) plugin = g_object_new (GST_TYPE_PLUGIN, NULL); plugin->file_mtime = file_status.st_mtime; plugin->file_size = file_status.st_size; + plugin->filename = g_strdup (filename); + plugin->basename = g_path_get_basename (filename); } plugin->module = module; - plugin->filename = g_strdup (filename); - plugin->basename = g_path_get_basename (filename); ret = g_module_symbol (module, "gst_plugin_desc", &ptr); if (!ret) { @@ -623,6 +623,9 @@ gst_plugin_load_file (const gchar * filename, GError ** error) CHECK_PLUGIN_DESC_FIELD (plugin->orig_desc, source, filename); CHECK_PLUGIN_DESC_FIELD (plugin->orig_desc, package, filename); CHECK_PLUGIN_DESC_FIELD (plugin->orig_desc, origin, filename); + } else { + /* this is overwritten by gst_plugin_register_func() */ + g_free (plugin->desc.description); } GST_LOG ("Plugin %p for file \"%s\" prepared, calling entry function...",