Skip to content

Commit

Permalink
vsisimple: explicitly allow NULL in VSIFree and VSIRealloc [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lnicola committed Nov 28, 2024
1 parent 4cfbcf8 commit 6acebb7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions port/cpl_vsisimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ static void VSICheckMarkerEnd(char *ptr, size_t nEnd)
/* VSIRealloc() */
/************************************************************************/

/** Analog of realloc(). Use VSIFree() to free */
/** Analog of realloc(). Use VSIFree() to free.
*
* If the pointer is NULL, VSIRealloc is equivalent to VSIMalloc.
*/
void *VSIRealloc(void *pData, size_t nNewSize)

{
Expand Down Expand Up @@ -824,7 +827,11 @@ void *VSIRealloc(void *pData, size_t nNewSize)
/************************************************************************/

/** Analog of free() for data allocated with VSIMalloc(), VSICalloc(),
* VSIRealloc() */
* VSIRealloc().
*
* It is not an error to call VSIFree with a NULL pointer, and it will
* have no effect.
*/
void VSIFree(void *pData)

{
Expand Down

0 comments on commit 6acebb7

Please sign in to comment.