1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-21 01:59:07 +03:00

r11593: added a data_blob_realloc() function

This commit is contained in:
Andrew Tridgell 2005-11-09 08:06:56 +00:00 committed by Gerald (Jerry) Carter
parent 5c7f3fef3e
commit e04262d391

View File

@ -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;
}