When I sent data by calling the send_data() function, I constructed a std:: string temporary object, but a memory leak occurred. The data held by the temporary object does not seem to be released. Can someone help me ?
crow::websocket::connect* conn;
char* data_ptr;
std::size_t data_size;
/* accept connect .... */
data_ptr=new char[6220800];
data_size=6220800;
conn->send_binary(std::string(data_ptr,data_size)); //memory leak!!!
delete [] data_ptr;
// but temporary string memory is not release
Use gcc12 compiler and C++20 on openSUSE system
When I sent data by calling the send_data() function, I constructed a std:: string temporary object, but a memory leak occurred. The data held by the temporary object does not seem to be released. Can someone help me ?
Use gcc12 compiler and C++20 on openSUSE system