diff options
-rw-r--r-- | source4/librpc/rpc/dcerpc.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index ea1ae76b4e..9b7d5bb47d 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -856,13 +856,16 @@ req_done: req->state = RPC_REQUEST_DONE; DLIST_REMOVE(c->pending, req); data_blob_free(data); - if (req->async.callback) { - req->async.callback(req); - } if (c->request_queue != NULL) { + /* We have to look at shipping further requests before calling + * the async function, that one might close the pipe */ dcerpc_ship_next_request(c); } + + if (req->async.callback) { + req->async.callback(req); + } } /* |