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:
DRC
2020-01-08 14:22:35 -06:00
parent fdf8903354
commit 00607ec260
7 changed files with 19 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2009-2015, 2017 D. R. Commander. All Rights Reserved.
* Copyright (C)2009-2015, 2017, 2020 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -1636,7 +1636,8 @@ DLLEXPORT int tjSaveImage(const char *filename, unsigned char *buffer,
* (re)allocated by the compression and transform functions or that were
* manually allocated using #tjAlloc().
*
* @param buffer address of the buffer to free
* @param buffer address of the buffer to free. If the address is NULL, then
* this function has no effect.
*
* @sa tjAlloc()
*/