mirror of
https://github.com/TheAlgorithms/C.git
synced 2026-02-08 05:44:43 +00:00
The call to realloc() already frees the previously allocated memory if necessary. By the man page of realloc(): "f the area pointed to was moved, a free(ptr) is done.", and free(): "If free(ptr) has already been called before, undefined behavior occurs.".