s3:libsmb: call TALLOC_FREE(subreq) directly after cli_sesssetup_blob_recv()
authorStefan Metzmacher <metze@samba.org>
Tue, 20 Sep 2011 02:57:45 +0000 (04:57 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 27 Sep 2011 22:24:43 +0000 (00:24 +0200)
cli_sesssetup_blob_recv() talloc moves stuff that's needed on
the given memory context.

metze

source3/libsmb/cliconnect.c

index fbd25b12b9839b6064d6b308a6fd72506052325a..d2512ec2956b9e1958316f4cb31b15f426e2c5f7 100644 (file)
@@ -1464,8 +1464,8 @@ static void cli_session_setup_kerberos_done(struct tevent_req *subreq)
        NTSTATUS status;
 
        status = cli_sesssetup_blob_recv(subreq, talloc_tos(), NULL, &inbuf);
+       TALLOC_FREE(subreq);
        if (!NT_STATUS_IS_OK(status)) {
-               TALLOC_FREE(subreq);
                tevent_req_nterror(req, status);
                return;
        }
@@ -1475,11 +1475,10 @@ static void cli_session_setup_kerberos_done(struct tevent_req *subreq)
        if (cli_simple_set_signing(state->cli, state->session_key_krb5,
                                   data_blob_null)
            && !cli_check_sign_mac(state->cli, inbuf, 1)) {
-               TALLOC_FREE(subreq);
                tevent_req_nterror(req, NT_STATUS_ACCESS_DENIED);
                return;
        }
-       TALLOC_FREE(subreq);
+
        tevent_req_done(req);
 }