mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Merge data_blob_talloc_zero() from samba4.
Guenther
This commit is contained in:
parent
e904a3dd53
commit
9fca3ca37e
@ -144,3 +144,15 @@ DATA_BLOB data_blob_const(const void *p, size_t length)
|
|||||||
blob.free = NULL;
|
blob.free = NULL;
|
||||||
return blob;
|
return blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
construct a zero data blob, using supplied TALLOC_CTX.
|
||||||
|
use this sparingly as it initialises data - better to initialise
|
||||||
|
yourself if you want specific data in the blob
|
||||||
|
**/
|
||||||
|
DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length)
|
||||||
|
{
|
||||||
|
DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, length);
|
||||||
|
data_blob_clear(&blob);
|
||||||
|
return blob;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user