mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-18 06:00:47 +01:00
cairo-test-runner: don't leak argv
If CAIRO_TESTS is set, argv will be replaced by a xmaloc'ed variable. We need to free it. This can be easily detected by running: CAIRO_TESTS=user-font make check-valgrind TARGETS=image Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
572479ec20
commit
ee15e030d8
1 changed files with 7 additions and 1 deletions
|
|
@ -715,6 +715,7 @@ main (int argc, char **argv)
|
|||
unsigned int n, m;
|
||||
char targets[4096];
|
||||
int len;
|
||||
char *cairo_tests_env;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
/* We don't want an assert dialog, we want stderr */
|
||||
|
|
@ -752,7 +753,9 @@ main (int argc, char **argv)
|
|||
}
|
||||
|
||||
_parse_cmdline (&runner, &argc, &argv);
|
||||
append_argv (&argc, &argv, getenv ("CAIRO_TESTS"));
|
||||
|
||||
cairo_tests_env = getenv("CAIRO_TESTS");
|
||||
append_argv (&argc, &argv, cairo_tests_env);
|
||||
|
||||
if (runner.full_test) {
|
||||
runner.num_device_offsets = 2;
|
||||
|
|
@ -1072,6 +1075,9 @@ main (int argc, char **argv)
|
|||
|
||||
}
|
||||
|
||||
if (cairo_tests_env)
|
||||
free(argv);
|
||||
|
||||
if (runner.list_only) {
|
||||
printf ("\n");
|
||||
return CAIRO_TEST_SUCCESS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue