ext/ffmpeg/: fix memleaks
authorBenjamin Otte <otte@gnome.org>
Tue, 6 Apr 2004 18:25:55 +0000 (18:25 +0000)
committerBenjamin Otte <otte@gnome.org>
Tue, 6 Apr 2004 18:25:55 +0000 (18:25 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
fix memleaks

ChangeLog
ext/ffmpeg/gstffmpegdec.c
ext/ffmpeg/gstffmpegdemux.c

index a349ab4..4e78516 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-04-06  Benjamin Otte  <otte@gnome.org>
+
+       * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register):
+       * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
+         fix memleaks
+
 2004-04-05  Benjamin Otte  <otte@gnome.org>
 
        * configure.ac:
index 6726287..1239843 100644 (file)
@@ -495,8 +495,11 @@ gst_ffmpegdec_register (GstPlugin * plugin)
     /* first make sure we've got a supported type */
     sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
     srccaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
-    if (!sinkcaps || !srccaps)
+    if (!sinkcaps || !srccaps) {
+      if (sinkcaps) gst_caps_free (sinkcaps);
+      if (srccaps) gst_caps_free (srccaps);
       goto next;
+    }
 
     /* construct the type */
     type_name = g_strdup_printf ("ffdec_%s", in_plugin->name);
index d2377e7..dd5ec8f 100644 (file)
@@ -744,6 +744,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
         !gst_type_find_register (plugin, typefind_name, GST_RANK_MARGINAL,
             gst_ffmpegdemux_type_find, extensions, sinkcaps, params)) {
       g_warning ("Register of type ffdemux_%s failed", name);
+      g_free (type_name);
+      g_free (typefind_name);
       return FALSE;
     }