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 afd9262274..c6471fbf54 100644
--- a/source4/lib/data_blob.c
+++ b/source4/lib/data_blob.c
@@ -183,6 +183,17 @@ DATA_BLOB data_blob_const(const void *p, size_t length)
/*
+ realloc a data_blob
+*/
+NTSTATUS data_blob_realloc(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, size_t length)
+{
+ blob->data = talloc_realloc_size(mem_ctx, blob->data, length);
+ NT_STATUS_HAVE_NO_MEMORY(blob->data);
+ blob->length = length;
+ return NT_STATUS_OK;
+}
+
+/*
append some data to a data blob
*/
NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
@@ -195,3 +206,4 @@ NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
blob->length += length;
return NT_STATUS_OK;
}
+