Not free external allocated memory blocks.

The pointer wsi->user_space is an external allocated memory block.
For caller (the user of libwebsocket), it will be clearer ownership that libwebsocket don’t free it but let the owner do handling the cleanup and free.
Ah, you are right. Thank you. I believe this was my misunderstanding of the logic.
In fact I was invoking the method **libwebsocket_client_connect_extended** with a memory block as the last parameter. But the per_session_data doesn't zero at the moment. That cause the issue.