diff options
author | Stefan Metzmacher <metze@samba.org> | 2005-11-10 13:52:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:46:05 -0500 |
commit | f0c7fca7807431a73e389e10a25e756afefd2afe (patch) | |
tree | 81b8bdd1e0c2f0c4ceb87b8454488dcaab7c6a29 /source4/lib | |
parent | bd7525e1b478a56c441d510de67c5acbc3247898 (diff) | |
download | samba-f0c7fca7807431a73e389e10a25e756afefd2afe.tar.gz samba-f0c7fca7807431a73e389e10a25e756afefd2afe.tar.bz2 samba-f0c7fca7807431a73e389e10a25e756afefd2afe.zip |
r11642: add some error checks
metze
(This used to be commit 9d6406d8daeff0a9bde72ce7749d18fa61324e8a)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/stream/packet.c | 10 |
1 files changed, 8 insertions, 2 deletions
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); } |