From 8e29a788e4f9d83251743ebd6eb2f23c90552309 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 2 Feb 2004 20:27:13 +0000 Subject: [PATCH] Fix memory leaks: Original commit message from CVS: reviewed by: David Schleef Fix memory leaks: * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_register): * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register): --- ext/ffmpeg/gstffmpegdec.c | 6 +++++- ext/ffmpeg/gstffmpegenc.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ext/ffmpeg/gstffmpegdec.c b/ext/ffmpeg/gstffmpegdec.c index 6828406..ddb4372 100644 --- a/ext/ffmpeg/gstffmpegdec.c +++ b/ext/ffmpeg/gstffmpegdec.c @@ -517,8 +517,12 @@ gst_ffmpegdec_register (GstPlugin *plugin) /* create the gtype now */ type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0); - if (!gst_element_register (plugin, type_name, GST_RANK_MARGINAL, type)) + if (!gst_element_register (plugin, type_name, GST_RANK_MARGINAL, type)) { + g_free (type_name); return FALSE; + } + + g_free (type_name); g_hash_table_insert (global_plugins, GINT_TO_POINTER (type), diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c index adfc197..87609be 100644 --- a/ext/ffmpeg/gstffmpegenc.c +++ b/ext/ffmpeg/gstffmpegenc.c @@ -661,8 +661,12 @@ gst_ffmpegenc_register (GstPlugin *plugin) /* create the glib type now */ type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0); - if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type)) + if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type)) { + g_free (type_name); return FALSE; + } + + g_free (type_name); g_hash_table_insert (enc_global_plugins, GINT_TO_POINTER (type), -- 2.7.4