summaryrefslogtreecommitdiff
path: root/source4/auth/gensec
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/auth/gensec
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/auth/gensec')
-rw-r--r--source4/auth/gensec/socket.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/source4/auth/gensec/socket.c b/source4/auth/gensec/socket.c
index 257ea7b094..9bd97109fb 100644
--- a/source4/auth/gensec/socket.c
+++ b/source4/auth/gensec/socket.c
@@ -86,13 +86,11 @@ _PUBLIC_ NTSTATUS gensec_wrap_packets(struct gensec_security *gensec_security,
}
RSIVAL(out->data, 0, wrapped.length);
- nt_status = data_blob_append(mem_ctx, out, wrapped.data, wrapped.length);
-
- if (!NT_STATUS_IS_OK(nt_status)) {
- return nt_status;
+ if (!data_blob_append(mem_ctx, out, wrapped.data, wrapped.length)) {
+ return NT_STATUS_NO_MEMORY;
}
*len_processed = unwrapped.length;
- return nt_status;
+ return NT_STATUS_OK;
}
return gensec_security->ops->wrap_packets(gensec_security, mem_ctx, in, out,
len_processed);
@@ -311,6 +309,7 @@ static NTSTATUS gensec_socket_unwrap(void *private, DATA_BLOB blob)
if (packet_size != blob.length) {
DEBUG(0, ("gensec_socket_unwrap: Did not consume entire packet!\n"));
+ talloc_free(mem_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
@@ -318,10 +317,14 @@ static NTSTATUS gensec_socket_unwrap(void *private, DATA_BLOB blob)
* gensec_socket_recv() and gensec_socket_pending() walk the
* linked list */
- nt_status = data_blob_append(gensec_socket, &gensec_socket->read_buffer,
- unwrapped.data, unwrapped.length);
+ if (!data_blob_append(gensec_socket, &gensec_socket->read_buffer,
+ unwrapped.data, unwrapped.length)) {
+ talloc_free(mem_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+
talloc_free(mem_ctx);
- return nt_status;
+ return NT_STATUS_OK;
}
/* when the data is sent, we know we have not been interrupted */