From 687dea8de634d6d0e1e4ee9a0550f258cd63a014 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 5 Nov 2005 09:32:15 +0000 Subject: r11516: Fix a valgrind bug I introduce with queued requests (This used to be commit 3e4ab756f421acd747e9ea4c48b0f61d48dfa8fd) --- source4/librpc/rpc/dcerpc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/librpc/rpc/dcerpc.c') 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); + } } /* -- cgit