Avoid a talloc/free
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
*/
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;
}