Skip to content

Commit

Permalink
ws: release TCP connection if not static
Browse files Browse the repository at this point in the history
This should fix a memory leak (reported in #743 by Eric Tamme)

(cherry picked from commit 29190f3)
  • Loading branch information
razvancrainea committed Jan 14, 2016
1 parent 548eb53 commit 5d813f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/proto_ws/ws_handshake.c
Expand Up @@ -148,8 +148,9 @@ int ws_handshake(struct tcp_connection *con)
goto error;
}

init_tcp_req(req, 0);
con->msg_attempts = 0;
if (req != &_ws_common_tcp_current_req)
pkg_free(req);

/* handshake now completed, destroy the handshake data */
WS_SET_STATE(con, WS_CON_HANDSHAKE_DONE);
Expand Down

0 comments on commit 5d813f6

Please sign in to comment.