Making std::unique_ptr memory safe
I was working with a very large C++ codebase and saw some segmentation faults due to wrong usage of smart pointers. The errors are mostly due to usage of a memory location after deallocation. One simple example of this is as follows: