summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-07-08 09:30:58 +0200
committerStefan Metzmacher <metze@samba.org>2011-07-08 14:09:08 +0200
commit2b8e1480840db7ef8128352b1808a5ee91a03ca1 (patch)
tree0053935fdfbbb16817c82434e933fee3458b6496 /source3/client
parent0ecd15abe612347e3e3f579d6038220a29833a21 (diff)
downloadsamba-2b8e1480840db7ef8128352b1808a5ee91a03ca1.tar.gz
samba-2b8e1480840db7ef8128352b1808a5ee91a03ca1.tar.bz2
samba-2b8e1480840db7ef8128352b1808a5ee91a03ca1.zip
s3:client: close the socket if receive_smb_raw() fails
metze
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index b4e2b5e525..130dbe0dcf 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4942,6 +4942,11 @@ static void readline_callback(void)
status = receive_smb_raw(cli->fd, cli->inbuf, cli->bufsize, 0, 0, &len);
if (!NT_STATUS_IS_OK(status)) {
+ if (cli->fd != -1) {
+ close(cli->fd);
+ cli->fd = -1;
+ }
+
DEBUG(0, ("Read from server failed, maybe it closed "
"the connection\n"));