Fix some memory leakage in test cases
Fix the memory leakage in following test cases: tests/bug_overflow_lagre_new_size.c, tests/gdimagecrop/bug00486.c, tests/bmp/bug00450.cmaster
parent
a48dbca620
commit
08238a0ac2
|
@ -4,7 +4,8 @@
|
|||
#include "gdtest.h"
|
||||
|
||||
int main(void) {
|
||||
gdImagePtr im = gdImageCreateFromFile(gdTestFilePath("bmp/bug00450.bmp"));
|
||||
char *path = gdTestFilePath("bmp/bug00450.bmp");
|
||||
gdImagePtr im = gdImageCreateFromFile(path);
|
||||
gdTestAssert(im != NULL);
|
||||
|
||||
if (im) {
|
||||
|
@ -33,5 +34,7 @@ int main(void) {
|
|||
gdImageDestroy(im);
|
||||
}
|
||||
|
||||
free(path);
|
||||
|
||||
return gdNumFailures();
|
||||
}
|
||||
|
|
|
@ -40,5 +40,9 @@ int main()
|
|||
|
||||
gdAssertImageEquals(croppedRight, croppedLeft);
|
||||
|
||||
gdImageDestroy(orig);
|
||||
gdImageDestroy(croppedLeft);
|
||||
gdImageDestroy(croppedRight);
|
||||
|
||||
return gdNumFailures();
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ int main()
|
|||
im2 = gdImageScale(im,0x15555556, 1);
|
||||
if (im2 == NULL) {
|
||||
printf("gdImageScale failed, expected (out of memory or overflow validation\n");
|
||||
gdImageDestroy(im);
|
||||
return 0;
|
||||
}
|
||||
gdImageDestroy(im);
|
||||
|
|
Loading…
Reference in New Issue