dolphindb / DolphinDBPlugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kdb+ plugin uses unsafe C++ code

FlyingOE opened this issue · comments

commented

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());

commented

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);

commented

This is not exception-safe:

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