Add new check-valgrind target for running the test suite under the influence of valgrind.

Fix memory leak when reference image is not found.
This commit is contained in:
Carl Worth 2005-07-15 10:39:59 +00:00
parent 07d09acf2a
commit 2534057cb5
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,11 @@
2005-07-15 Carl Worth <cworth@cworth.org>
* test/Makefile.am: Add new check-valgrind target for running the
test suite under the influence of valgrind.
* test/buffer-diff.c: (image_diff): Fix memory leak when reference
image is not found.
2005-07-15 Carl Worth <cworth@cworth.org>
* test/mask.c: (set_gradient_pattern), (set_image_pattern),

View file

@ -179,3 +179,6 @@ CLEANFILES = \
ps-surface.ps \
pdf-surface.pdf \
pdf-clip.pdf
check-valgrind:
TESTS_ENVIRONMENT="libtool --mode=execute valgrind --tool=memcheck --leak-check=yes --show-reachable=yes" $(MAKE) check

View file

@ -112,8 +112,10 @@ image_diff (const char *filename_a,
return -1;
status = read_png_argb32 (filename_b, &buf_b, &width_b, &height_b, &stride_b);
if (status)
if (status) {
free (buf_a);
return -1;
}
if (width_a != width_b ||
height_a != height_b ||