From 50a9ae3608fdd54bd626320f55df20f0a1806002 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 6 Apr 2004 18:25:55 +0000 Subject: [PATCH] ext/ffmpeg/: fix memleaks Original commit message from CVS: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register): * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register): fix memleaks --- ChangeLog | 6 ++++++ ext/ffmpeg/gstffmpegdec.c | 5 ++++- ext/ffmpeg/gstffmpegdemux.c | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a349ab4..4e78516 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-04-06 Benjamin Otte + + * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register): + * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register): + fix memleaks + 2004-04-05 Benjamin Otte * configure.ac: diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 6726287..1239843 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -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); diff --git a/ext/ffmpeg/gstffmpegdemux.c b/ext/ffmpeg/gstffmpegdemux.c index d2377e7..dd5ec8f 100644 --- a/ext/ffmpeg/gstffmpegdemux.c +++ b/ext/ffmpeg/gstffmpegdemux.c @@ -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; } -- 2.7.4