Better to use a smart pointer than explicit allocation and deallocation.