Skip to content

Commit

Permalink
missing null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Dec 10, 2024
1 parent 1b74118 commit 0d1a1c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/udx.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ close_stream (udx_stream_t *stream, int err) {
udx_t *udx = stream->udx;
udx_socket_t *socket = stream->socket;

if (socket) {
if (socket != NULL) {
udx__link_remove(socket->streams, stream);
} else {
udx__link_remove(udx->streams, stream);
Expand Down Expand Up @@ -641,7 +641,7 @@ close_stream (udx_stream_t *stream, int err) {
uv_close((uv_handle_t *) &stream->tlp_timer, finalize_maybe);
uv_close((uv_handle_t *) &stream->zwp_timer, finalize_maybe);

if (udx->teardown && socket->streams == NULL) {
if (udx->teardown && socket != NULL && socket->streams == NULL) {
udx_socket_close(socket);
}

Expand Down

0 comments on commit 0d1a1c3

Please sign in to comment.