From 7c01df4e77a08ec44ad32cc4c123f98fa270842f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 20 Jun 2006 06:05:10 +0000 Subject: r16401: keep the old pointer when realloc fails, this is needed for the search callback metze (This used to be commit c868b8b7d7ee0424ed955f699543593aaa633e92) --- source4/smb_server/smb/trans2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source4/smb_server/smb/trans2.c b/source4/smb_server/smb/trans2.c index 16a2e14f30..dd97f73698 100644 --- a/source4/smb_server/smb/trans2.c +++ b/source4/smb_server/smb/trans2.c @@ -67,8 +67,10 @@ static NTSTATUS trans2_grow_data(TALLOC_CTX *mem_ctx, uint32_t new_size) { if (new_size > blob->length) { - blob->data = talloc_realloc(mem_ctx, blob->data, uint8_t, new_size); - NT_STATUS_HAVE_NO_MEMORY(blob->data); + uint8_t *p; + p = talloc_realloc(mem_ctx, blob->data, uint8_t, new_size); + NT_STATUS_HAVE_NO_MEMORY(p); + blob->data = p; } blob->length = new_size; return NT_STATUS_OK; -- cgit