summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-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"));