Skip to content

Commit

Permalink
proto_wss: proper cleanup wss connection in case of tls error
Browse files Browse the repository at this point in the history
When TLS domain is not found, or the SSL context cannot be created, make
sure the connection does not keep an hanging `proto_data` that will be
later double-freed by the cleanup routine.

Credits go to Jonathan Hulme (@digipigeon) for reporting this.

Close #2123
  • Loading branch information
razvancrainea committed Jun 16, 2020
1 parent ac23e00 commit 6bae525
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/proto_wss/proto_wss.c
Expand Up @@ -288,6 +288,7 @@ static int wss_conn_init(struct tcp_connection* c)

ret = tls_conn_init(c, &tls_mgm_api);
if (ret < 0) {
c->proto_data = NULL;
LM_ERR("Cannot initiate the conn\n");
shm_free(d);
}
Expand Down

0 comments on commit 6bae525

Please sign in to comment.