Eliminate unnecessary NULL checks before tjFree()
+ document that tjFree() accepts NULL pointers without complaint. Effectively, it has had that behavior all along, but the API does not guarantee that tjFree() will be implemented with free() behind the scenes, so it's best to formalize the behavior.
This commit is contained in:
@@ -550,7 +550,7 @@ static void doTest(int w, int h, const int *formats, int nformats, int subsamp,
|
||||
bailout:
|
||||
if (chandle) tjDestroy(chandle);
|
||||
if (dhandle) tjDestroy(dhandle);
|
||||
if (dstBuf) tjFree(dstBuf);
|
||||
tjFree(dstBuf);
|
||||
}
|
||||
|
||||
|
||||
@@ -666,7 +666,7 @@ static void bufSizeTest(void)
|
||||
|
||||
bailout:
|
||||
free(srcBuf);
|
||||
if (dstBuf) tjFree(dstBuf);
|
||||
tjFree(dstBuf);
|
||||
if (handle) tjDestroy(handle);
|
||||
}
|
||||
|
||||
@@ -839,7 +839,7 @@ static int doBmpTest(const char *ext, int width, int align, int height, int pf,
|
||||
unlink(filename);
|
||||
|
||||
bailout:
|
||||
if (buf) tjFree(buf);
|
||||
tjFree(buf);
|
||||
if (exitStatus < 0) return exitStatus;
|
||||
return retval;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user