validate: Plug minor leak in issue creation error path
authorThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 18 Jul 2017 14:05:02 +0000 (10:05 -0400)
committerThibault Saunier <thibault.saunier@osg.samsung.com>
Tue, 18 Jul 2017 14:10:06 +0000 (10:10 -0400)
CID 1415494

validate/gst/validate/gst-validate-report.c

index 16d23aeede50957cd772e04a72d93236f0ef68a0..313e4d2b9eb21fbdd5fd2bb61fd96e27071156c6 100644 (file)
@@ -157,8 +157,13 @@ gst_validate_issue_new (GstValidateIssueId issue_id, const gchar * summary,
   GstValidateIssue *issue = g_slice_new (GstValidateIssue);
   gchar **area_name = g_strsplit (g_quark_to_string (issue_id), "::", 2);
 
-  g_return_val_if_fail (area_name[0] != NULL && area_name[1] != 0 &&
-      area_name[2] == NULL, NULL);
+  if (!(area_name[0] != NULL && area_name[1] != NULL && area_name[2] == NULL)) {
+    g_warning ("Wrong issue ID: %s (should be in the form: area::name)",
+        g_quark_to_string (issue_id));
+    g_strfreev (area_name);
+
+    return NULL;
+  }
 
   issue->issue_id = issue_id;
   issue->summary = g_strdup (summary);