diff options
author | Günther Deschner <gd@samba.org> | 2008-02-13 10:19:06 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-02-13 10:20:10 +0100 |
commit | 0622fd72a341889fead15a50369f7ed39cc66edc (patch) | |
tree | 3cfec20fb0f0a8b090d39ed8f20b8ddb51f8a9f8 | |
parent | 85e3c091d41391454528ac95628b73057409df4d (diff) | |
download | samba-0622fd72a341889fead15a50369f7ed39cc66edc.tar.gz samba-0622fd72a341889fead15a50369f7ed39cc66edc.tar.bz2 samba-0622fd72a341889fead15a50369f7ed39cc66edc.zip |
Merge data_blob_talloc_zero() from samba4.
Guenther
(This used to be commit 9fca3ca37eaf10c24f852e854dd28b7155c3e536)
-rw-r--r-- | source3/lib/data_blob.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/data_blob.c b/source3/lib/data_blob.c index 8bbbc32d7b..daba17df14 100644 --- a/source3/lib/data_blob.c +++ b/source3/lib/data_blob.c @@ -144,3 +144,15 @@ DATA_BLOB data_blob_const(const void *p, size_t length) blob.free = NULL; 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; +} |