aboutsummaryrefslogtreecommitdiff
path: root/websocket.c
diff options
context:
space:
mode:
Diffstat (limited to 'websocket.c')
-rw-r--r--websocket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/websocket.c b/websocket.c
index ab33a88..fe4a39a 100644
--- a/websocket.c
+++ b/websocket.c
@@ -66,8 +66,9 @@ int ws_close(websocket* ws, ws_close_reason code, char* reason){
for(p = 0; p < ws->protocols; p++){
free(ws->protocol[p]);
}
- ws->protocols = 0;
+ free(ws->protocol);
ws->protocol = NULL;
+ ws->protocols = 0;
ws->read_buffer_offset = 0;
ws->peer_buffer_offset = 0;