summaryrefslogtreecommitdiff
path: root/source4/lib/data_blob.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/data_blob.c')
-rw-r--r--source4/lib/data_blob.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/lib/data_blob.c b/source4/lib/data_blob.c
index 7803179d39..d2147be6b2 100644
--- a/source4/lib/data_blob.c
+++ b/source4/lib/data_blob.c
@@ -61,6 +61,18 @@ DATA_BLOB data_blob_talloc_named(TALLOC_CTX *mem_ctx, const void *p, size_t leng
return ret;
}
+
+/*******************************************************************
+ construct a data blob which is a reference to another blob, in
+the given mem context
+*******************************************************************/
+DATA_BLOB data_blob_talloc_reference(TALLOC_CTX *mem_ctx, DATA_BLOB *blob)
+{
+ DATA_BLOB ret = *blob;
+ ret.data = talloc_reference(mem_ctx, ret.data);
+ return ret;
+}
+
/*******************************************************************
construct a zero data blob, using supplied TALLOC_CTX.
use this sparingly as it initialises data - better to initialise