Skip to content
Snippets Groups Projects
Commit bebc1bb8 authored by Andy Green's avatar Andy Green
Browse files

valgrind free rx_user_buffer if entered CONNMODE_WS_SERVING


This seems to be enough to get a clean valgrind run for the
test server with 1 x chrome and 1 x libwebsockets-test-client
session being run for 10s

lwsts[19767]: libwebsockets-test-server exited cleanly
==19767==
==19767== HEAP SUMMARY:
==19767==     in use at exit: 0 bytes in 0 blocks
==19767==   total heap usage: 41,071 allocs, 41,071 frees, 27,464,834 bytes allocated
==19767==
==19767== All heap blocks were freed -- no leaks are possible
==19767==
==19767== For counts of detected and suppressed errors, rerun with: -v
==19767== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

test client is another story...

Signed-off-by: default avatarAndy Green <andy.green@linaro.org>
parent a7109e6e
No related branches found
No related tags found
No related merge requests found
...@@ -312,7 +312,7 @@ just_kill_connection: ...@@ -312,7 +312,7 @@ just_kill_connection:
wsi->state = WSI_STATE_DEAD_SOCKET; wsi->state = WSI_STATE_DEAD_SOCKET;
if (old_state == WSI_STATE_ESTABLISHED && wsi->u.ws.rx_user_buffer) { if ((old_state == WSI_STATE_ESTABLISHED || wsi->mode == LWS_CONNMODE_WS_SERVING) && wsi->u.ws.rx_user_buffer) {
free(wsi->u.ws.rx_user_buffer); free(wsi->u.ws.rx_user_buffer);
wsi->u.ws.rx_user_buffer = NULL; wsi->u.ws.rx_user_buffer = NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment