From 969113688733d2b3060d581a71e54a056a52a7dd Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 20 Mar 2015 11:33:01 +0100 Subject: [PATCH] validate: override-registry: fix structs list leak The list returned by _lines_get_strutures() needs to be deeply freed. --- validate/gst/validate/gst-validate-override-registry.c | 8 ++++++-- validate/gst/validate/gst-validate-utils.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/validate/gst/validate/gst-validate-override-registry.c b/validate/gst/validate/gst-validate-override-registry.c index 7de89ef9e3..348243cb78 100644 --- a/validate/gst/validate/gst-validate-override-registry.c +++ b/validate/gst/validate/gst-validate-override-registry.c @@ -319,10 +319,14 @@ _load_text_override_file (const gchar * filename) } } - return ret; + goto done; } - return WRONG_FILE; + ret = WRONG_FILE; + +done: + g_list_free_full (structs, (GDestroyNotify) gst_structure_free); + return ret; } int diff --git a/validate/gst/validate/gst-validate-utils.c b/validate/gst/validate/gst-validate-utils.c index 6022fd197c..2fa9a177bc 100644 --- a/validate/gst/validate/gst-validate-utils.c +++ b/validate/gst/validate/gst-validate-utils.c @@ -596,6 +596,7 @@ _get_lines (const gchar * scenario_file) return lines; } +/* Returns: (transfer full): a #GList of #GstStructure */ static GList * _lines_get_strutures (gchar ** lines) {