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
This commit is contained in:
Aurélien Zanelli 2014-07-18 15:57:24 +02:00 committed by Thibault Saunier
parent cf540d002b
commit d1c261f5b1
2 changed files with 6 additions and 6 deletions

View file

@ -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;

View file

@ -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,