summaryrefslogtreecommitdiff
path: root/source4/lib/stream
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-08-29 13:07:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:03:10 -0500
commit0b91f3916430d0271eab867675d44c5439de40c2 (patch)
tree8740c4d73ec89cd60125117ed45e80b771e9e06b /source4/lib/stream
parentb867b3c1470ee260fe2fd14f628728f01f7917ac (diff)
downloadsamba-0b91f3916430d0271eab867675d44c5439de40c2.tar.gz
samba-0b91f3916430d0271eab867675d44c5439de40c2.tar.bz2
samba-0b91f3916430d0271eab867675d44c5439de40c2.zip
r24780: More work allowing libutil to be used by external users.
(This used to be commit 31993cf67b816a184a4a4e92ef8ca2532c797190)
Diffstat (limited to 'source4/lib/stream')
-rw-r--r--source4/lib/stream/packet.c15
1 files changed, 6 insertions, 9 deletions
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 {