Protect against a closed socket
authorVolker Lendecke <vl@sernet.de>
Fri, 5 Sep 2008 09:47:48 +0000 (11:47 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 5 Sep 2008 10:33:48 +0000 (12:33 +0200)
source/libsmb/async_smb.c

index a4c58aa5c7e321ca248f102d73f3d4b26fa82137..435c8c1cb9d7bc7d6bb4fef7ec0a4306158174a4 100644 (file)
@@ -382,6 +382,11 @@ bool cli_chain_cork(struct cli_state *cli, struct event_context *ev,
 
        SMB_ASSERT(cli->chain_accumulator == NULL);
 
+       if (cli->fd == -1) {
+               DEBUG(10, ("cli->fd closed\n"));
+               return false;
+       }
+
        if (cli->fd_event == NULL) {
                SMB_ASSERT(cli->outstanding_requests == NULL);
                cli->fd_event = event_add_fd(ev, cli, cli->fd,