aboutsummaryrefslogtreecommitdiff
path: root/tjunittest.c
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-08-22 19:27:28 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2014-08-22 19:27:28 +0000
commit3c2088cc68dc99c6a614ae5d7fe6b8752ef33e4b (patch)
treedb9e6d9c429f185531db55a8304f67ede58b8eb8 /tjunittest.c
parent2bd51cf2fb1c491c17b8aa2765c6d1e6f3f8efac (diff)
Ensure that tjFree() is used for any JPEG buffers that might have been dynamically allocated by the compress/transform functions. To keep things simple, we use tjAlloc() for the statically-allocated buffer as well, so that tjFree() can always be used to free the buffer, regardless of whether it was allocated by tjbench or by the TurboJPEG library. This fixes crashes that occurred on Windows when running tjunittest or tjbench with the -alloc flag.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1383 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'tjunittest.c')
-rw-r--r--tjunittest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tjunittest.c b/tjunittest.c
index 9ac6626..0c81cbe 100644
--- a/tjunittest.c
+++ b/tjunittest.c
@@ -681,7 +681,7 @@ void bufSizeTest(void)
bailout:
if(srcBuf) free(srcBuf);
- if(dstBuf) free(dstBuf);
+ if(dstBuf) tjFree(dstBuf);
if(handle) tjDestroy(handle);
}