From 0b91f3916430d0271eab867675d44c5439de40c2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 29 Aug 2007 13:07:03 +0000 Subject: r24780: More work allowing libutil to be used by external users. (This used to be commit 31993cf67b816a184a4a4e92ef8ca2532c797190) --- source4/lib/stream/packet.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'source4/lib/stream') diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c index 3f4fcb1ef7..e6cfae7bd6 100644 --- a/source4/lib/stream/packet.c +++ b/source4/lib/stream/packet.c @@ -281,9 +281,8 @@ _PUBLIC_ void packet_recv(struct packet_context *pc) /* possibly expand the partial packet buffer */ if (npending + pc->num_read > pc->partial.length) { - status = data_blob_realloc(pc, &pc->partial, npending+pc->num_read); - if (!NT_STATUS_IS_OK(status)) { - packet_error(pc, status); + if (!data_blob_realloc(pc, &pc->partial, npending+pc->num_read)) { + packet_error(pc, NT_STATUS_NO_MEMORY); return; } } @@ -322,9 +321,8 @@ _PUBLIC_ void packet_recv(struct packet_context *pc) next_partial: if (pc->partial.length != pc->num_read) { - status = data_blob_realloc(pc, &pc->partial, pc->num_read); - if (!NT_STATUS_IS_OK(status)) { - packet_error(pc, status); + if (!data_blob_realloc(pc, &pc->partial, pc->num_read)) { + packet_error(pc, NT_STATUS_NO_MEMORY); return; } } @@ -361,9 +359,8 @@ next_partial: return; } /* Trunate the blob sent to the caller to only the packet length */ - status = data_blob_realloc(pc, &blob, pc->packet_size); - if (!NT_STATUS_IS_OK(status)) { - packet_error(pc, status); + if (!data_blob_realloc(pc, &blob, pc->packet_size)) { + packet_error(pc, NT_STATUS_NO_MEMORY); return; } } else { -- cgit