s3: Explicitly handle inbuf in cli_message_start_done
authorVolker Lendecke <vl@samba.org>
Sat, 20 Feb 2010 14:25:34 +0000 (15:25 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 22 Feb 2010 22:23:20 +0000 (23:23 +0100)
source3/libsmb/clifile.c
source3/libsmb/climessage.c

index ec81cf92019b7e26a27fc1502dda1c8a1bcb991a..6e7a74f8d5d6e42d938008e14c0fe685b15b3439 100644 (file)
@@ -4061,19 +4061,18 @@ static void cli_ctemp_done(struct tevent_req *subreq)
        uint16_t *vwv;
        uint32_t num_bytes = 0;
        uint8_t *bytes = NULL;
+       uint8_t *inbuf;
 
-       status = cli_smb_recv(subreq, NULL, NULL, 1, &wcnt, &vwv,
+       status = cli_smb_recv(subreq, state, &inbuf, 1, &wcnt, &vwv,
                              &num_bytes, &bytes);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(subreq);
                tevent_req_nterror(req, status);
                return;
        }
 
        state->fnum = SVAL(vwv+0, 0);
 
-       TALLOC_FREE(subreq);
-
        /* From W2K3, the result is just the ASCII name */
        if (num_bytes < 2) {
                tevent_req_nterror(req, NT_STATUS_DATA_ERROR);
index 170447b2539fa53dfbba734ed83288000dba0f11..bdf2977af9c4cff744d397b402dec5bcbe7ca7fb 100644 (file)
@@ -91,8 +91,11 @@ static void cli_message_start_done(struct tevent_req *subreq)
        NTSTATUS status;
        uint8_t wct;
        uint16_t *vwv;
+       uint8_t *inbuf;
 
-       status = cli_smb_recv(subreq, NULL, NULL, 0, &wct, &vwv, NULL, NULL);
+       status = cli_smb_recv(subreq, state, &inbuf, 0, &wct, &vwv,
+                             NULL, NULL);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(subreq);
                tevent_req_nterror(req, status);
@@ -103,7 +106,6 @@ static void cli_message_start_done(struct tevent_req *subreq)
        } else {
                state->grp = 0;
        }
-       TALLOC_FREE(subreq);
        tevent_req_done(req);
 }