I\'m working on a section of code that has many possible failure points which cause it to exit the function early. The libraries I\'m interacting with require that C-style
Use boost::scoped_array, or even better std::vector if you are dealing with an array.
boost::scoped_array
std::vector