summaryrefslogtreecommitdiff
path: root/source3/libsmb/async_smb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/async_smb.c')
-rw-r--r--source3/libsmb/async_smb.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 2e0ddb9fdb..c09a886f5e 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -153,6 +153,14 @@ void cli_smb_req_unset_pending(struct tevent_req *req)
int num_pending = talloc_array_length(cli->pending);
int i;
+ if (state->mid != 0) {
+ /*
+ * This is a [nt]trans[2] request which waits
+ * for more than one reply.
+ */
+ return;
+ }
+
if (num_pending == 1) {
/*
* The pending read_smb tevent_req is a child of
@@ -193,6 +201,13 @@ void cli_smb_req_unset_pending(struct tevent_req *req)
static int cli_smb_req_destructor(struct tevent_req *req)
{
+ struct cli_smb_state *state = tevent_req_data(
+ req, struct cli_smb_state);
+ /*
+ * Make sure we really remove it from
+ * the pending array on destruction.
+ */
+ state->mid = 0;
cli_smb_req_unset_pending(req);
return 0;
}