validate: don't leak not maching config structures

Reviewers: thiblahute

Differential Revision: http://phabricator.freedesktop.org/D158
This commit is contained in:
Guillaume Desmottes 2015-05-11 14:25:49 +02:00 committed by Thibault Saunier
parent c2fef15266
commit 596daaed74

View file

@ -99,10 +99,15 @@ create_config (const gchar * path, const gchar * suffix)
structures = gst_validate_utils_structs_parse_from_filename (path);
for (tmp = structures; tmp; tmp = tmp->next) {
if (gst_structure_has_name (tmp->data, suffix))
result = g_list_append (result, tmp->data);
GstStructure *structure = tmp->data;
if (gst_structure_has_name (structure, suffix))
result = g_list_append (result, structure);
else
gst_structure_free (structure);
}
g_list_free (structures);
return result;
}