Free old buffer if realloc fail