C++ don't like 'goto' but directly 'return'. 'goto errors' in C code just to avoid mem leaks. C++ doesn't have this issue. no need to keep.