From 2b8e1480840db7ef8128352b1808a5ee91a03ca1 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 8 Jul 2011 09:30:58 +0200 Subject: s3:client: close the socket if receive_smb_raw() fails metze --- source3/client/client.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/client') 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")); -- cgit