From 4ec6bda043582f0b17fa6ff0083609147b964c0a Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Wed, 5 Apr 2017 14:40:12 -0700 Subject: [PATCH] validate: report: avoid pointless var & associated dup/free Just pass the replacement string literal to _regex_replace(). --- validate/gst/validate/gst-validate-report.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index c5d591ef7c..f23905184a 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -868,7 +868,7 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args) } else if (*(GType *) source == GST_TYPE_VALIDATE_ACTION_TYPE) { gint i; - gchar *desc, *tmp; + gchar *desc; gboolean has_parameters = FALSE; GstValidateActionParameter playback_time_param = { @@ -896,13 +896,10 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args) "at the beginning of the execution of the pipeline)"); - tmp = g_strdup_printf ("\n "); - desc = - g_regex_replace (newline_regex, type->description, -1, 0, tmp, 0, - NULL); + desc = g_regex_replace (newline_regex, type->description, -1, 0, "\n ", + 0, NULL); g_string_append_printf (string, "\n\n Description: \n %s", desc); g_free (desc); - g_free (tmp); if (!IS_CONFIG_ACTION_TYPE (type->flags)) print_action_parameter (string, type, &playback_time_param);