From 76591077389a05cc5d706326f1bf590ddf6eec5b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Nov 2005 08:06:56 +0000 Subject: r11593: added a data_blob_realloc() function (This used to be commit e04262d391d81f863256a9fe69a2884fbce641af) --- source4/lib/data_blob.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source4/lib') 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 @@ -182,6 +182,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 */ @@ -195,3 +206,4 @@ NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, blob->length += length; return NT_STATUS_OK; } + -- cgit