diff options
author | Volker Lendecke <vl@samba.org> | 2009-01-27 19:41:34 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-01-28 16:18:15 +0100 |
commit | c001b456cf0c9fdfd90a5239e3b86168d0fbb5aa (patch) | |
tree | 23c64b0323be8dc5b17f88d646ca3837c2d24e1b /source3 | |
parent | 1021c752ea4fec887d732ac02b8cfbadc45d8686 (diff) | |
download | samba-c001b456cf0c9fdfd90a5239e3b86168d0fbb5aa.tar.gz samba-c001b456cf0c9fdfd90a5239e3b86168d0fbb5aa.tar.bz2 samba-c001b456cf0c9fdfd90a5239e3b86168d0fbb5aa.zip |
Fix a valgrind error when the socket dies
Don't reference anything that might have been deleted in the async_req_error
call.
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/async_smb.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index a1fcf8eb07..a4bbe6d79d 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -1022,7 +1022,7 @@ static void cli_state_handler(struct event_context *event_ctx, struct fd_event *event, uint16 flags, void *p) { struct cli_state *cli = (struct cli_state *)p; - struct cli_request *req; + struct cli_request *req, *next; NTSTATUS status; DEBUG(11, ("cli_state_handler called with flags %d\n", flags)); @@ -1128,9 +1128,14 @@ static void cli_state_handler(struct event_context *event_ctx, return; sock_error: - for (req = cli->outstanding_requests; req; req = req->next) { - int i; - for (i=0; i<req->num_async; i++) { + + for (req = cli->outstanding_requests; req; req = next) { + int i, num_async; + + next = req->next; + num_async = req->num_async; + + for (i=0; i<num_async; i++) { async_req_error(req->async[i], status); } } |