Skip to content

Memory leak when websocket sends data #700

Description

@SSDGADsss

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions