This fixes a memory leak when exceptions are thrown by the Impl classes in the read function variants of
Serial::read (std::vector<uint8_t> &buffer, size_t size) & Serial::read (std::string &buffer, size_t size)
An alternate strategy for the fix could have been to use smart pointers but chose the proposed fix so as to be inline with the coding conventions used in the library.
This fixes a memory leak when exceptions are thrown by the Impl classes in the read function variants of
Serial::read (std::vector<uint8_t> &buffer, size_t size)
&Serial::read (std::string &buffer, size_t size)
An alternate strategy for the fix could have been to use smart pointers but chose the proposed fix so as to be inline with the coding conventions used in the library.