benchmarks: Fix potential stack corruption in capsnego test

flavour_str is a non-const pointer that will be written to if the -f
option is passed
This commit is contained in:
Nirbheek Chauhan 2016-07-11 18:45:49 +05:30 committed by Tim-Philipp Müller
parent 59885c2a92
commit 6e01d03d90

View file

@ -185,7 +185,7 @@ gint
main (gint argc, gchar * argv[])
{
/* default parameters */
const gchar *flavour_str = "audio";
gchar *flavour_str = g_strdup("audio");
gint flavour = FLAVOUR_AUDIO;
gint children = 3;
gint depth = 4;
@ -230,6 +230,8 @@ main (gint argc, gchar * argv[])
/* build pipeline */
g_print ("building %s pipeline with depth = %d and children = %d\n",
flavour_str, depth, children);
g_free (flavour_str);
start = gst_util_get_timestamp ();
bin = GST_BIN (gst_pipeline_new ("pipeline"));
sink = gst_element_factory_make ("fakesink", NULL);