From: Vineeth TM Date: Mon, 5 Oct 2015 02:12:47 +0000 (+0900) Subject: tests/gst-launch: Fix sample memory leak X-Git-Tag: 1.10.4~754 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=456ef2aa1d912a8af5283907d2ffb8ca51481c2a;p=platform%2Fupstream%2Fgstreamer.git tests/gst-launch: Fix sample memory leak When sample is got using gst_tag_list_get_sample_index, it should be free'd. https://bugzilla.gnome.org/show_bug.cgi?id=756069 --- diff --git a/tests/check/gst/gsttag.c b/tests/check/gst/gsttag.c index 7a5e5ca..75c84da 100644 --- a/tests/check/gst/gsttag.c +++ b/tests/check/gst/gsttag.c @@ -373,9 +373,13 @@ GST_START_TEST (test_buffer_tags) gst_sample_unref (s2); fail_if (gst_tag_list_get_sample_index (tags, GST_TAG_IMAGE, 1, &s1)); + gst_sample_unref (s1); fail_if (gst_tag_list_get_sample_index (tags, GST_TAG_IMAGE, 2, &s1)); + gst_sample_unref (s1); fail_if (gst_tag_list_get_sample_index (tags, GST_TAG_PREVIEW_IMAGE, 1, &s1)); + gst_sample_unref (s1); fail_if (gst_tag_list_get_sample_index (tags, GST_TAG_PREVIEW_IMAGE, 2, &s1)); + gst_sample_unref (s1); fail_if (!gst_tag_list_get_sample_index (tags, GST_TAG_IMAGE, 0, &s1)); fail_if (!gst_tag_list_get_sample_index (tags, GST_TAG_PREVIEW_IMAGE, 0, diff --git a/tools/gst-launch.c b/tools/gst-launch.c index 839bd64..a522a5b 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -371,6 +371,7 @@ print_tag (const GstTagList * list, const gchar * tag, gpointer unused) g_warning ("Couldn't fetch sample for %s tag", tag); g_assert_not_reached (); } + gst_sample_unref (sample); } else if (gst_tag_get_type (tag) == GST_TYPE_DATE_TIME) { GstDateTime *dt = NULL;