summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-11-01 15:11:16 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-11-01 15:11:16 +0000
commitb1b1fe52d611670c7718533d67d164e4ffa3c975 (patch)
tree4b64917f9370caae9866c94fa7726771100c8416 /tests
parentc88fb97881c3e2df9d0d273e3b8957875532f9f7 (diff)
Fix leaks and invalid memory access as reported by valgrind
Original commit message from CVS: * check/elements/matroskamux.c: (setup_src_pad), (setup_sink_pad), (setup_matroskamux), (check_buffer_data), (GST_START_TEST): * gst/matroska/matroska-mux.c: (gst_matroska_mux_finalize), (gst_matroska_mux_reset), (gst_matroska_mux_audio_pad_setcaps), (gst_matroska_mux_start), (gst_matroska_mux_write_data), (gst_matroska_mux_collected): Fix leaks and invalid memory access as reported by valgrind
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/matroskamux.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/check/elements/matroskamux.c b/tests/check/elements/matroskamux.c
index 8b31014e..30bf09f1 100644
--- a/tests/check/elements/matroskamux.c
+++ b/tests/check/elements/matroskamux.c
@@ -56,15 +56,16 @@ static GstStaticPadTemplate srcac3template = GST_STATIC_PAD_TEMPLATE ("src",
GstPad *
setup_src_pad (GstElement * element,
- GstStaticPadTemplate * srctemplate, GstCaps * caps)
+ GstStaticPadTemplate * template, GstCaps * caps)
{
GstPad *srcpad, *sinkpad;
+ GstPadTemplate *templ;
GST_DEBUG_OBJECT (element, "setting up sending pad");
/* sending pad */
- srcpad =
- gst_pad_new_from_template (gst_static_pad_template_get (srctemplate),
- "src");
+ templ = gst_static_pad_template_get (template);
+ srcpad = gst_pad_new_from_template (templ, "src");
+ gst_object_unref (templ);
fail_if (srcpad == NULL, "Could not create a srcpad");
ASSERT_OBJECT_REFCOUNT (srcpad, "srcpad", 1);
@@ -110,12 +111,14 @@ setup_sink_pad (GstElement * element, GstStaticPadTemplate * template,
GstCaps * caps)
{
GstPad *srcpad, *sinkpad;
+ GstPadTemplate *templ;
GST_DEBUG_OBJECT (element, "setting up receiving pad");
/* receiving pad */
- sinkpad =
- gst_pad_new_from_template (gst_static_pad_template_get (template),
- "sink");
+ templ = gst_static_pad_template_get (template);
+ sinkpad = gst_pad_new_from_template (templ, "sink");
+ gst_object_unref (templ);
+
fail_if (sinkpad == NULL, "Could not create a sinkpad");
srcpad = gst_element_get_pad (element, "src");