Use malloc instead of alloca in cmafihe