summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-09 08:06:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:55 -0500
commit76591077389a05cc5d706326f1bf590ddf6eec5b (patch)
tree3adc63afe76e7bbfe3b857fecbe8bebcab77db75 /source4/lib
parent9a52d1a467c9ba601ab85a064bdb3d8732f53efd (diff)
downloadsamba-76591077389a05cc5d706326f1bf590ddf6eec5b.tar.gz
samba-76591077389a05cc5d706326f1bf590ddf6eec5b.tar.bz2
samba-76591077389a05cc5d706326f1bf590ddf6eec5b.zip
r11593: added a data_blob_realloc() function
(This used to be commit e04262d391d81f863256a9fe69a2884fbce641af)
Diffstat (limited to 'source4/lib')
-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;
}
+