dolphindb/DolphinDBPlugin

kdb+ plugin uses unsafe C++ code

Opened this issue · 2 comments

Assigning the result of str.c_str() to a pointer to be used later is against the C++ standard and is not safe. For example:

char* host = const_cast<char*>(hostStr.c_str());

There is also potential memory leak upon initial qIPC call in kdb::loadTable:

K res = k(handle_, arg,(K)0);

K loadRes = k(handle_, loadArg,(K)0);

This is not exception-safe:

Connection* cup = new Connection(hostStr, port, usrStr);