From b817f16e19c90742a74e1083dba4d5a6f33f00e6 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Fri, 7 Apr 2017 10:36:34 +0100 Subject: [PATCH] tests: fix leak in videoframe-audiolevel test also add braces for the else case https://bugzilla.gnome.org/show_bug.cgi?id=781022 --- tests/check/elements/videoframe-audiolevel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/check/elements/videoframe-audiolevel.c b/tests/check/elements/videoframe-audiolevel.c index 9d57390e4a..f64f860b33 100644 --- a/tests/check/elements/videoframe-audiolevel.c +++ b/tests/check/elements/videoframe-audiolevel.c @@ -299,17 +299,20 @@ on_message (GstBus * bus, GstMessage * message, gpointer user_data) gdouble rms; gint channels2; guint i; - GstClockTime *rtime = g_new (GstClockTime, 1); + GstClockTime *rtime; if (message->type != GST_MESSAGE_ELEMENT || strcmp (name, "videoframe-audiolevel") != 0) goto done; num_msgs++; - if (!gst_structure_get_clock_time (s, "running-time", rtime)) + rtime = g_new (GstClockTime, 1); + if (!gst_structure_get_clock_time (s, "running-time", rtime)) { g_warning ("Could not parse running time"); - else + g_free (rtime); + } else { g_queue_push_tail (&msg_timestamp_q, rtime); + } /* the values are packed into GValueArrays with the value per channel */ array_val = gst_structure_get_value (s, "rms");