From d1c261f5b1759cc619acd5c633f3f24c60e1bebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Zanelli?= Date: Fri, 18 Jul 2014 15:57:24 +0200 Subject: [PATCH] validate: duplicate strings in gst_validate_issue_new() Do this to avoid discarding 'const' qualifier when using it with constant strings. Moreover it will avoid a g_free on constant string. https://bugzilla.gnome.org/show_bug.cgi?id=733362 --- validate/gst/validate/gst-validate-report.c | 8 ++++---- validate/gst/validate/gst-validate-report.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index 6641473fc4..f454c4359a 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -62,14 +62,14 @@ gst_validate_issue_get_id (GstValidateIssue * issue) } GstValidateIssue * -gst_validate_issue_new (GstValidateIssueId issue_id, gchar * summary, - gchar * description, GstValidateReportLevel default_level) +gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary, + const gchar * description, GstValidateReportLevel default_level) { GstValidateIssue *issue = g_slice_new (GstValidateIssue); issue->issue_id = issue_id; - issue->summary = summary; - issue->description = description; + issue->summary = g_strdup (summary); + issue->description = g_strdup (description); issue->default_level = default_level; issue->repeat = FALSE; diff --git a/validate/gst/validate/gst-validate-report.h b/validate/gst/validate/gst-validate-report.h index a799e25639..174574088e 100644 --- a/validate/gst/validate/gst-validate-report.h +++ b/validate/gst/validate/gst-validate-report.h @@ -183,8 +183,8 @@ void gst_validate_report_init (void); GstValidateIssue *gst_validate_issue_from_id (GstValidateIssueId issue_id); GstValidateIssueId gst_validate_issue_get_id (GstValidateIssue * issue); void gst_validate_issue_register (GstValidateIssue * issue); -GstValidateIssue *gst_validate_issue_new (GstValidateIssueId issue_id, gchar * summary, - gchar * description, +GstValidateIssue *gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary, + const gchar * description, GstValidateReportLevel default_level); GstValidateReport *gst_validate_report_new (GstValidateIssue * issue,