From e033362cb516ad10b470a682397cda7073213cf1 Mon Sep 17 00:00:00 2001 From: seamxr Date: Wed, 25 Jun 2014 14:09:17 -0700 Subject: [PATCH] Not free external allocated memory blocks. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pointer wsi->user_space is an external allocated memory block. So it will be clearer that libwebsocket don’t free it but let the block owner (the user of libwebsocket) to handle the cleanup and free. --- lib/libwebsockets.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 2975f38e4..6ab57789e 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -278,10 +278,6 @@ just_kill_connection: context->protocols[0].callback(context, wsi, LWS_CALLBACK_WSI_DESTROY, wsi->user_space, NULL, 0); - if (wsi->protocol && wsi->protocol->per_session_data_size && - wsi->user_space) /* user code may own */ - free(wsi->user_space); - free(wsi); }