Use the right type in realloc()