fixed realloc warnings