change "malloc" to "realloc"