diff --git a/validate/gst/validate/validate.c b/validate/gst/validate/validate.c index c3d980d1c7..d58bf285d2 100644 --- a/validate/gst/validate/validate.c +++ b/validate/gst/validate/validate.c @@ -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; }