remove realloc in wrong scope