diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/async_smb.c | 13 | ||||
-rw-r--r-- | source3/libsmb/clientgen.c | 5 |
2 files changed, 4 insertions, 14 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index aac303c22e..724e8b7d4f 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -489,10 +489,7 @@ static void cli_smb_sent(struct tevent_req *subreq) nwritten = writev_recv(subreq, &err); TALLOC_FREE(subreq); if (nwritten == -1) { - if (state->cli->fd != -1) { - close(state->cli->fd); - state->cli->fd = -1; - } + cli_state_disconnect(state->cli); tevent_req_nterror(req, map_nt_error_from_unix(err)); return; } @@ -537,10 +534,7 @@ static void cli_smb_received(struct tevent_req *subreq) received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err); TALLOC_FREE(subreq); if (received == -1) { - if (cli->fd != -1) { - close(cli->fd); - cli->fd = -1; - } + cli_state_disconnect(cli); status = map_nt_error_from_unix(err); goto fail; } @@ -620,8 +614,7 @@ static void cli_smb_received(struct tevent_req *subreq) DEBUG(10, ("cli_check_sign_mac failed\n")); TALLOC_FREE(inbuf); status = NT_STATUS_ACCESS_DENIED; - close(cli->fd); - cli->fd = -1; + cli_state_disconnect(cli); goto fail; } diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index c394197ad9..7a417ec6c0 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -321,10 +321,7 @@ static void _cli_shutdown(struct cli_state *cli) data_blob_free(&cli->secblob); data_blob_free(&cli->user_session_key); - if (cli->fd != -1) { - close(cli->fd); - } - cli->fd = -1; + cli_state_disconnect(cli); /* * Need to free pending first, they remove themselves |