summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-11-10 00:36:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:45:59 -0500
commitb8f4d22ab5f5b93a6cf36d82d70843bfd106968b (patch)
treeb886715c3b09f4698b93e0f99e691fc83ee5c5f0
parent65baaafc34b2befac50541c5aef86e5d906d2797 (diff)
downloadsamba-b8f4d22ab5f5b93a6cf36d82d70843bfd106968b.tar.gz
samba-b8f4d22ab5f5b93a6cf36d82d70843bfd106968b.tar.bz2
samba-b8f4d22ab5f5b93a6cf36d82d70843bfd106968b.zip
r11621: some minor fixes from comments by metze
(This used to be commit 6ab808223475ba7c52dbe4d639af9a8e7f64b202)
-rw-r--r--source4/kdc/kdc.c6
-rw-r--r--source4/smb_server/smb_server.c4
2 files changed, 7 insertions, 3 deletions
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index a79dc8457e..e633b5baa7 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -204,7 +204,8 @@ static void kdc_tcp_terminate_connection(struct kdc_tcp_connection *kdcconn, con
*/
static NTSTATUS kdc_tcp_recv(void *private, DATA_BLOB blob)
{
- struct kdc_tcp_connection *kdcconn = talloc_get_type(private, struct kdc_tcp_connection);
+ struct kdc_tcp_connection *kdcconn = talloc_get_type(private,
+ struct kdc_tcp_connection);
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
TALLOC_CTX *tmp_ctx = talloc_new(kdcconn);
const char *src_addr;
@@ -255,8 +256,7 @@ nomem:
status = NT_STATUS_NO_MEMORY;
failed:
- kdc_tcp_terminate_connection(kdcconn, nt_errstr(status));
- return NT_STATUS_OK;
+ return status;
}
/*
diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c
index 6d2ffc0274..0ec15aea56 100644
--- a/source4/smb_server/smb_server.c
+++ b/source4/smb_server/smb_server.c
@@ -662,6 +662,10 @@ static void smbsrv_accept(struct stream_connection *conn)
smb_conn->negotiate.calling_name = NULL;
smb_conn->packet = packet_init(smb_conn);
+ if (smb_conn->packet == NULL) {
+ stream_terminate_connection(conn, "out of memory");
+ return;
+ }
packet_set_private(smb_conn->packet, smb_conn);
packet_set_socket(smb_conn->packet, conn->socket);
packet_set_callback(smb_conn->packet, receive_smb_request);