From f0c7fca7807431a73e389e10a25e756afefd2afe Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 10 Nov 2005 13:52:07 +0000 Subject: r11642: add some error checks metze (This used to be commit 9d6406d8daeff0a9bde72ce7749d18fa61324e8a) --- source4/lib/stream/packet.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/lib/stream/packet.c') diff --git a/source4/lib/stream/packet.c b/source4/lib/stream/packet.c index a272b28c0c..14933ff963 100644 --- a/source4/lib/stream/packet.c +++ b/source4/lib/stream/packet.c @@ -317,7 +317,11 @@ next_partial: packet_error(pc, NT_STATUS_NO_MEMORY); return; } - data_blob_realloc(pc, &blob, pc->packet_size); + status = data_blob_realloc(pc, &blob, pc->packet_size); + if (!NT_STATUS_IS_OK(status)) { + packet_error(pc, status); + return; + } } else { pc->partial = data_blob(NULL, 0); } @@ -440,7 +444,9 @@ NTSTATUS packet_send(struct packet_context *pc, DATA_BLOB blob) /* if we aren't going to free the packet then we must reference it to ensure it doesn't disappear before going out */ if (pc->nofree) { - talloc_reference(el, blob.data); + if (!talloc_reference(el, blob.data)) { + return NT_STATUS_NO_MEMORY; + } } else { talloc_steal(el, blob.data); } -- cgit