From 63ab004e38b24929b3f578e5db0574938c63aeb5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 29 Sep 2020 10:53:42 +0200 Subject: libcli: Use GUID_to_ndr_buf() in smbXcli_negprot_smb2_subreq() Avoid a talloc/free Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- libcli/smb/smbXcli_base.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libcli') diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 7d2da4b9ebc..687a9896b48 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -4749,14 +4749,14 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta } 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(&state->conn->smb2.client.guid, - state, &blob); + status = GUID_to_ndr_buf(&state->conn->smb2.client.guid, + &guid_buf); if (!NT_STATUS_IS_OK(status)) { return NULL; } - memcpy(buf+12, blob.data, 16); /* ClientGuid */ + memcpy(buf+12, guid_buf.buf, 16); /* ClientGuid */ } else { memset(buf+12, 0, 16); /* ClientGuid */ } -- cgit v1.2.1