Skip to content

Commit

Permalink
fix for potential leaking connections
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Dec 27, 2024
1 parent c64d0e5 commit 5183093
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/sp/transport/socket/sockfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ sfd_tran_pipe_nego_cb(void *arg)
int rv;

nni_mtx_lock(&ep->mtx);

if (ep->closed) {
rv = NNG_ECLOSED;
goto error;
}
if ((rv = nni_aio_result(aio)) != 0) {
goto error;
}
Expand Down
5 changes: 4 additions & 1 deletion src/sp/transport/tcp/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ tcptran_pipe_nego_cb(void *arg)
int rv;

nni_mtx_lock(&ep->mtx);

if (ep->closed) {
rv = NNG_ECLOSED;
goto error;
}
if ((rv = nni_aio_result(aio)) != 0) {
goto error;
}
Expand Down
4 changes: 4 additions & 0 deletions src/sp/transport/tls/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ tlstran_pipe_nego_cb(void *arg)
int rv;

nni_mtx_lock(&ep->mtx);
if (ep->closed) {
rv = NNG_ECLOSED;
goto error;

Check warning on line 180 in src/sp/transport/tls/tls.c

View check run for this annotation

Codecov / codecov/patch

src/sp/transport/tls/tls.c#L179-L180

Added lines #L179 - L180 were not covered by tests
}
if ((rv = nni_aio_result(aio)) != 0) {
goto error;
}
Expand Down

0 comments on commit 5183093

Please sign in to comment.