mirror of
https://github.com/samba-team/samba.git
synced 2025-09-10 05:44:20 +03:00
Merge data_blob_talloc_zero() from samba4.
Guenther
(This used to be commit 9fca3ca37e
)
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user