]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbXcli: Align smb2cli_req_create() with tevent_req conventions
authorVolker Lendecke <vl@samba.org>
Thu, 29 Sep 2022 09:00:41 +0000 (11:00 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 3 Oct 2022 20:03:32 +0000 (20:03 +0000)
We don't return NULL if tevent_req_create() succeeded, and elsewhere
in this function we already pass tevent_req_nterror or
tevent_req_nomem (via set_endtime).

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
libcli/smb/smbXcli_base.c

index 47f385349c4124222e8996ad0461c79782b30664..29ece6a271aee1b45e281b23ed2739f6234cc690 100644 (file)
@@ -3081,9 +3081,8 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
        }
 
        state->smb2.recv_iov = talloc_zero_array(state, struct iovec, 3);
-       if (state->smb2.recv_iov == NULL) {
-               TALLOC_FREE(req);
-               return NULL;
+       if (tevent_req_nomem(state->smb2.recv_iov, req)) {
+               return req;
        }
 
        flags |= additional_flags;