so I have a piece of memory allocated with malloc() and changed later with realloc().
malloc()
realloc()
At some point in my code I want to empty it, by this
realloc() is used to increase or decrease the memory and not to free the memory.
Check this, and use free() to release the memory (link).
free()