gst/gstplugin.c: Call g_module_close when we don't load the module
authorJan Schmidt <thaytan@mad.scientist.com>
Wed, 7 Sep 2005 15:22:29 +0000 (15:22 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Wed, 7 Sep 2005 15:22:29 +0000 (15:22 +0000)
Original commit message from CVS:
* gst/gstplugin.c: (gst_plugin_load_file):
Call g_module_close when we don't load the module

* gst/registries/gstlibxmlregistry.c:
(gst_xml_registry_get_property):
Port leak fix from 0.8

ChangeLog
gst/gstplugin.c
gst/registries/gstlibxmlregistry.c

index 0f5687f..8696757 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-09-07  Jan Schmidt  <thaytan@mad.scientist.com>
+
+       * gst/gstplugin.c: (gst_plugin_load_file):
+         Call g_module_close when we don't load the module
+
+       * gst/registries/gstlibxmlregistry.c:
+       (gst_xml_registry_get_property):
+         Port leak fix from 0.8
+
 2005-09-07  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/gst/gstreamer-docs.sgml:
index 7e4958f..a18f1c7 100644 (file)
@@ -414,9 +414,12 @@ gst_plugin_load_file (const gchar * filename, GError ** error)
 
   module = g_module_open (filename, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
 
-  /* handle module == NULL case */
-  if (!gst_plugin_check_module (module, filename, error, &ptr))
+  /* gst_plugin_check_module handles module == NULL case */
+  if (!gst_plugin_check_module (module, filename, error, &ptr)) {
+    if (module != NULL)
+      g_module_close (module);
     return NULL;
+  }
 
   desc = (GstPluginDesc *) ptr;
 
index d99ef86..3f57f9d 100644 (file)
@@ -241,7 +241,7 @@ gst_xml_registry_get_property (GObject * object, guint prop_id,
 
   switch (prop_id) {
     case PROP_LOCATION:
-      g_value_set_string (value, g_strdup (registry->location));
+      g_value_set_string (value, registry->location);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);