This function is similar to the standard C "realloc" function except that it provides better security against programming errors and also supports the allocation of zero-size memory regions (indicated by a NULL pointer).
AST A Library for Handling World Coordinate Systems in Astronomy