s3:libsmb: keep the request order in cli_smb_req_unset_pending()
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Aug 2011 06:39:15 +0000 (08:39 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 12 Aug 2011 10:36:03 +0000 (12:36 +0200)
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Aug 12 12:36:03 CEST 2011 on sn-devel-104

source3/libsmb/async_smb.c

index 5396d2288131519baeb1f490169f7473ae75df66..488e9534367b508199a4d027c0b6b9647acc38ba 100644 (file)
@@ -162,7 +162,9 @@ void cli_smb_req_unset_pending(struct tevent_req *req)
        /*
         * Remove ourselves from the cli->conn.pending array
         */
-       cli->conn.pending[i] = cli->conn.pending[num_pending-1];
+       for (; i < (num_pending - 1); i++) {
+               cli->conn.pending[i] = cli->conn.pending[i+1];
+       }
 
        /*
         * No NULL check here, we're shrinking by sizeof(void *), and