diff --git a/libcli/ldap/ldap_ndr.c b/libcli/ldap/ldap_ndr.c index 1743415f0fd..4f63bc179e7 100644 --- a/libcli/ldap/ldap_ndr.c +++ b/libcli/ldap/ldap_ndr.c @@ -63,15 +63,15 @@ char *ldap_encode_ndr_dom_sid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid) */ char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, const struct GUID *guid) { - DATA_BLOB blob; + struct GUID_ndr_buf buf = { .buf = {0}, }; + DATA_BLOB blob = { .data = buf.buf, .length = sizeof(buf.buf), }; NTSTATUS status; char *ret; - status = GUID_to_ndr_blob(guid, mem_ctx, &blob); + status = GUID_to_ndr_buf(guid, &buf); if (!NT_STATUS_IS_OK(status)) { return NULL; } ret = ldb_binary_encode(mem_ctx, blob); - data_blob_free(&blob); return ret; }