validate-report: Fix a leak in error cases

CID #1415494
This commit is contained in:
Edward Hervey 2017-07-26 15:18:57 +02:00 committed by Edward Hervey
parent 9ae20ee3e0
commit 1b48ffdff5

View file

@ -154,7 +154,7 @@ GstValidateIssue *
gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary,
const gchar * description, GstValidateReportLevel default_level)
{
GstValidateIssue *issue = g_slice_new (GstValidateIssue);
GstValidateIssue *issue;
gchar **area_name = g_strsplit (g_quark_to_string (issue_id), "::", 2);
if (!(area_name[0] != NULL && area_name[1] != NULL && area_name[2] == NULL)) {
@ -165,6 +165,7 @@ gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary,
return NULL;
}
issue = g_slice_new (GstValidateIssue);
issue->issue_id = issue_id;
issue->summary = g_strdup (summary);
issue->description = g_strdup (description);