From: <en...@ke...> - 2007-08-16 07:08:07
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: ensonic Date: Thu Aug 16 2007 07:07:55 UTC Log message: * ext/ladspa/gstladspa.c: Don't leak like hell. Modified files: . : ChangeLog ext/ladspa : gstladspa.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2694&r2=1.2695 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/ladspa/gstladspa.c.diff?r1=1.61&r2=1.62 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2694 retrieving revision 1.2695 diff -u -d -r1.2694 -r1.2695 --- ChangeLog 16 Aug 2007 06:49:39 -0000 1.2694 +++ ChangeLog 16 Aug 2007 07:07:41 -0000 1.2695 @@ -1,5 +1,10 @@ 2007-08-16 Stefan Kost <en...@us...> + * ext/ladspa/gstladspa.c: + Don't leak like hell. + +2007-08-16 Stefan Kost <en...@us...> * tests/check/Makefile.am: * tests/check/generic/.cvsignore: * tests/check/generic/states.c: Index: gstladspa.c RCS file: /cvs/gstreamer/gst-plugins-bad/ext/ladspa/gstladspa.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- gstladspa.c 31 Jan 2007 08:16:59 -0000 1.61 +++ gstladspa.c 16 Aug 2007 07:07:41 -0000 1.62 @@ -105,6 +105,8 @@ else gst_signal_processor_class_add_pad_template (gsp_class, name, GST_PAD_SRC, gsp_class->num_audio_out++); + g_free (name); } else if (LADSPA_IS_PORT_CONTROL (p)) { if (LADSPA_IS_PORT_INPUT (p)) gsp_class->num_control_in++; @@ -133,6 +135,10 @@ } else details->klass = "Filter/Effect/Audio/LADSPA"; gst_element_class_set_details (element_class, details); + g_free (details->longname); + g_free (details->author); + g_free (details); klass->audio_in_portnums = g_new0 (gint, gsp_class->num_audio_in); klass->audio_out_portnums = g_new0 (gint, gsp_class->num_audio_out); @@ -197,6 +203,7 @@ gint n = 1; gchar *nret = g_strdup_printf ("%s-%d", ret, n++); + g_free (ret); while (g_object_class_find_property (G_OBJECT_CLASS (klass), nret)) { g_free (nret); nret = g_strdup_printf ("%s-%d", ret, n++); @@ -584,10 +591,8 @@ type_name = g_strdup_printf ("ladspa-%s", desc->Label); g_strcanon (type_name, G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-+", '-'); /* if it's already registered, drop it */ - if (g_type_from_name (type_name)) { - g_free (type_name); - continue; - } + if (g_type_from_name (type_name)) + goto next; /* base-init temp alloc */ g_hash_table_insert (ladspa_descriptors, @@ -598,11 +603,14 @@ g_type_register_static (GST_TYPE_SIGNAL_PROCESSOR, type_name, &typeinfo, 0); if (!gst_element_register (ladspa_plugin, type_name, GST_RANK_NONE, type)) /* add this plugin to the hash */ GINT_TO_POINTER (type), (gpointer) desc); + next: + g_free (type_name); } g_hash_table_remove (ladspa_descriptors, GINT_TO_POINTER (0)); |