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:
Paulo Zanoni 2011-09-09 14:17:39 -03:00 committed by Chris Wilson
parent 572479ec20
commit ee15e030d8

View file

@ -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;