mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
validate: Fix leak parsing structure files
This commit is contained in:
parent
d86fa2c44a
commit
1ee84f7c10
1 changed files with 3 additions and 0 deletions
|
@ -568,6 +568,7 @@ _file_get_structures (GFile * file, gchar ** err)
|
|||
/* TODO Handle GCancellable */
|
||||
if (!g_file_load_contents (file, NULL, &content, &size, NULL, &error)) {
|
||||
GST_WARNING ("Failed to load contents: %d %s", error->code, error->message);
|
||||
g_free (content);
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -652,10 +653,12 @@ _file_get_structures (GFile * file, gchar ** err)
|
|||
}
|
||||
|
||||
done:
|
||||
g_free (content);
|
||||
g_free (filename);
|
||||
return structures;
|
||||
|
||||
failed:
|
||||
g_free (content);
|
||||
if (structures)
|
||||
g_list_free_full (structures, (GDestroyNotify) gst_structure_free);
|
||||
structures = NULL;
|
||||
|
|
Loading…
Reference in a new issue