mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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 */
|
/* TODO Handle GCancellable */
|
||||||
if (!g_file_load_contents (file, NULL, &content, &size, NULL, &error)) {
|
if (!g_file_load_contents (file, NULL, &content, &size, NULL, &error)) {
|
||||||
GST_WARNING ("Failed to load contents: %d %s", error->code, error->message);
|
GST_WARNING ("Failed to load contents: %d %s", error->code, error->message);
|
||||||
|
g_free (content);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -652,10 +653,12 @@ _file_get_structures (GFile * file, gchar ** err)
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
g_free (content);
|
||||||
g_free (filename);
|
g_free (filename);
|
||||||
return structures;
|
return structures;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
g_free (content);
|
||||||
if (structures)
|
if (structures)
|
||||||
g_list_free_full (structures, (GDestroyNotify) gst_structure_free);
|
g_list_free_full (structures, (GDestroyNotify) gst_structure_free);
|
||||||
structures = NULL;
|
structures = NULL;
|
||||||
|
|
Loading…
Reference in a new issue