diff options
author | Pierre Joye <pierre.php@gmail.com> | 2021-08-13 21:57:22 +0700 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2021-08-13 21:57:22 +0700 |
commit | b68f9a34c08e01be823de04d448e4da9ddba9125 (patch) | |
tree | fd8c4ee15f96cbf218a43702a6dbf0098631c37d /tests | |
parent | 9cb2d1dcf568107542b839c373bcb4c6b14e8a2d (diff) | |
download | libgd-b68f9a34c08e01be823de04d448e4da9ddba9125.tar.gz |
fix leaks in tests and extend a bit the timeout for ASAN mode
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/gdimagefill/bug00002_1.c | 1 | ||||
-rw-r--r-- | tests/gdimagestringft/bug00615.c | 3 | ||||
-rw-r--r-- | tests/gif/gif_nocolormaps.c | 1 | ||||
-rw-r--r-- | tests/heif/heif_im2im.c | 4 |
5 files changed, 7 insertions, 5 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b279f63..d239f49 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ if (BUILD_TEST) - SET(DART_TESTING_TIMEOUT 5) + SET(DART_TESTING_TIMEOUT 15) INCLUDE(Dart) @@ -97,5 +97,4 @@ if (BUILD_TEST) FOREACH(test_dir ${TESTS_DIRS}) add_subdirectory (${test_dir}) ENDFOREACH(test_dir) - endif (BUILD_TEST) diff --git a/tests/gdimagefill/bug00002_1.c b/tests/gdimagefill/bug00002_1.c index 3feaf42..3a66d7b 100644 --- a/tests/gdimagefill/bug00002_1.c +++ b/tests/gdimagefill/bug00002_1.c @@ -21,6 +21,7 @@ int main() file = gdTestTempFile("bug00002_1.png"); fp = fopen(file, "wb"); + free(file); if (fp == NULL) { gdTestErrorMsg("Cannot create image from <%s>\n", file); gdImageDestroy(im); diff --git a/tests/gdimagestringft/bug00615.c b/tests/gdimagestringft/bug00615.c index 0da51da..7014fa0 100644 --- a/tests/gdimagestringft/bug00615.c +++ b/tests/gdimagestringft/bug00615.c @@ -20,6 +20,7 @@ int main() char *res = gdImageStringFT(im, rect, fg, path, 12, 0, 10, 10, ""); gdTestAssert(res == NULL); - + free(path); + gdImageDestroy(im); return gdNumFailures(); } diff --git a/tests/gif/gif_nocolormaps.c b/tests/gif/gif_nocolormaps.c index 4419904..6aa36f0 100644 --- a/tests/gif/gif_nocolormaps.c +++ b/tests/gif/gif_nocolormaps.c @@ -20,6 +20,7 @@ int main() im = gdImageCreateFromGif(fp); gdTestAssert(im != NULL); fclose(fp); + gdImageDestroy(im); return gdNumFailures(); } diff --git a/tests/heif/heif_im2im.c b/tests/heif/heif_im2im.c index 01abf02..0fa62c9 100644 --- a/tests/heif/heif_im2im.c +++ b/tests/heif/heif_im2im.c @@ -11,9 +11,9 @@ int main() { - gdImagePtr src, dst; + gdImagePtr src = NULL, dst = NULL; int r, g, b; - void *p; + void *p = NULL; int size = 0; CuTestImageResult result = {0, 0}; |