Skip to content

Commit

Permalink
Fix continuation websocket null pointer exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sbollie committed Sep 10, 2020
1 parent c419e48 commit de580d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ static struct uwsgi_buffer *uwsgi_websockets_parse(struct wsgi_request *wsgi_req
uwsgi_buffer_append(ub, "\0", 1);
return ub;
error:
uwsgi_buffer_destroy(ub);
/// avoid segfault
if (ub) uwsgi_buffer_destroy(ub);
if (uwsgi.websockets_continuation_buffer != NULL && ub != uwsgi.websockets_continuation_buffer) {
uwsgi_buffer_destroy(uwsgi.websockets_continuation_buffer);
}
Expand Down

0 comments on commit de580d8

Please sign in to comment.