Realloc apparently doesn't always behave like free() if size is zero.
Fixed segfault.