]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli: Use GUID_to_ndr_buf() in smb2cli_validate_negotiate_info_send()
authorVolker Lendecke <vl@samba.org>
Tue, 29 Sep 2020 08:55:07 +0000 (10:55 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 2 Oct 2020 22:50:43 +0000 (22:50 +0000)
Avoid a talloc/free

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct  2 22:50:43 UTC 2020 on sn-devel-184

libcli/smb/smbXcli_base.c

index 687a9896b48995661faad0836fefeb0cc2228a7e..967264586767f0dca5db9a8cd4e1bf81d2c26c03 100644 (file)
@@ -5327,14 +5327,14 @@ struct tevent_req *smb2cli_validate_negotiate_info_send(TALLOC_CTX *mem_ctx,
        }
        if (state->conn->max_protocol >= PROTOCOL_SMB2_10) {
                NTSTATUS status;
-               DATA_BLOB blob;
+               struct GUID_ndr_buf guid_buf = { .buf = {0}, };
 
-               status = GUID_to_ndr_blob(&conn->smb2.client.guid,
-                                         state, &blob);
+               status = GUID_to_ndr_buf(&conn->smb2.client.guid,
+                                        &guid_buf);
                if (!NT_STATUS_IS_OK(status)) {
                        return NULL;
                }
-               memcpy(buf+4, blob.data, 16); /* ClientGuid */
+               memcpy(buf+4, guid_buf.buf, 16); /* ClientGuid */
        } else {
                memset(buf+4, 0, 16);   /* ClientGuid */
        }