tests: audioconvert: Fix memory leak in failure path
authorJimmy Ohn <yongjin.ohn@lge.com>
Mon, 5 Jun 2017 05:08:33 +0000 (14:08 +0900)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 19 Jan 2018 18:47:06 +0000 (18:47 +0000)
Don't set a bad example by leaking things, even if calling
g_error() will make the process abort.

https://bugzilla.gnome.org/show_bug.cgi?id=783418

tests/check/elements/audioconvert.c

index 23c5341..d157ef8 100644 (file)
@@ -467,8 +467,9 @@ verify_convert (const gchar * which, void *in, int inlength,
     /* positions for 1 and 2 channels are implicit if not provided */
     if (out_chans > 2 && gst_structure_has_field (in_s, "channel-positions")) {
       if (!gst_structure_has_field (out_s, "channel-positions")) {
-        g_error ("Channel layout got lost somewhere:\n\nIns : %s\nOuts: %s\n",
-            gst_structure_to_string (in_s), gst_structure_to_string (out_s));
+        gst_printerrln ("In  : %" GST_PTR_FORMAT, in_s);
+        gst_printerrln ("Out : %" GST_PTR_FORMAT, out_s);
+        g_error ("Channel layout got lost somewhere\n");
       }
     }
     gst_caps_unref (ccaps);