diff options
Diffstat (limited to 'source3/libsmb/clifile.c')
-rw-r--r-- | source3/libsmb/clifile.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 63e6c474db..3c13383669 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1484,13 +1484,19 @@ struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev, int flags, int share_mode) { struct tevent_req *req, *subreq; + NTSTATUS status; req = cli_open_create(mem_ctx, ev, cli, fname, flags, share_mode, &subreq); - if ((req == NULL) || !cli_smb_req_send(subreq)) { - TALLOC_FREE(req); + if (req == NULL) { return NULL; } + + status = cli_smb_req_send(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return tevent_req_post(req, ev); + } return req; } @@ -1612,12 +1618,18 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, uint16_t fnum) { struct tevent_req *req, *subreq; + NTSTATUS status; req = cli_close_create(mem_ctx, ev, cli, fnum, &subreq); - if ((req == NULL) || !cli_smb_req_send(subreq)) { - TALLOC_FREE(req); + if (req == NULL) { return NULL; } + + status = cli_smb_req_send(subreq); + if (!NT_STATUS_IS_OK(status)) { + tevent_req_nterror(req, status); + return tevent_req_post(req, ev); + } return req; } |