git.samba.org
/
amitay
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85e3c09
)
Merge data_blob_talloc_zero() from samba4.
author
Günther Deschner
<gd@samba.org>
Wed, 13 Feb 2008 09:19:06 +0000
(10:19 +0100)
committer
Günther Deschner
<gd@samba.org>
Wed, 13 Feb 2008 09:20:10 +0000
(10:20 +0100)
Guenther
(This used to be commit
9fca3ca37eaf10c24f852e854dd28b7155c3e536
)
source3/lib/data_blob.c
patch
|
blob
|
history
diff --git
a/source3/lib/data_blob.c
b/source3/lib/data_blob.c
index 8bbbc32d7b1d62d9481ef8bfc8a0b5fbca520f23..daba17df14801ae8f4bbe6ef7656de665d6d7e4f 100644
(file)
--- 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;
+}