Use modern idiom for malloc() replacement.