Avert warnings: cast malloc retval