mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
check: don't leak xml file name if GST_CHECK_XML is set
Spotted by nvineeth@gmail.com
This commit is contained in:
parent
07c916be92
commit
9382017b42
1 changed files with 5 additions and 2 deletions
|
@ -571,19 +571,22 @@ gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes)
|
||||||
gint
|
gint
|
||||||
gst_check_run_suite (Suite * suite, const gchar * name, const gchar * fname)
|
gst_check_run_suite (Suite * suite, const gchar * name, const gchar * fname)
|
||||||
{
|
{
|
||||||
|
SRunner *sr;
|
||||||
|
gchar *xmlfilename = NULL;
|
||||||
gint nf;
|
gint nf;
|
||||||
|
|
||||||
SRunner *sr = srunner_create (suite);
|
sr = srunner_create (suite);
|
||||||
|
|
||||||
if (g_getenv ("GST_CHECK_XML")) {
|
if (g_getenv ("GST_CHECK_XML")) {
|
||||||
/* how lucky we are to have __FILE__ end in .c */
|
/* how lucky we are to have __FILE__ end in .c */
|
||||||
gchar *xmlfilename = g_strdup_printf ("%sheck.xml", fname);
|
xmlfilename = g_strdup_printf ("%sheck.xml", fname);
|
||||||
|
|
||||||
srunner_set_xml (sr, xmlfilename);
|
srunner_set_xml (sr, xmlfilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
srunner_run_all (sr, CK_NORMAL);
|
srunner_run_all (sr, CK_NORMAL);
|
||||||
nf = srunner_ntests_failed (sr);
|
nf = srunner_ntests_failed (sr);
|
||||||
|
g_free (xmlfilename);
|
||||||
srunner_free (sr);
|
srunner_free (sr);
|
||||||
return nf;
|
return nf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue