aboutsummaryrefslogtreecommitdiff
path: root/tools/plink/sshshare.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/plink/sshshare.c')
-rw-r--r--tools/plink/sshshare.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/plink/sshshare.c b/tools/plink/sshshare.c
index bf2a64c29..5b88eb8ed 100644
--- a/tools/plink/sshshare.c
+++ b/tools/plink/sshshare.c
@@ -517,6 +517,10 @@ void sharestate_free(void *v)
share_connstate_free(cs);
}
freetree234(sharestate->connections);
+ if (sharestate->listensock) {
+ sk_close(sharestate->listensock);
+ sharestate->listensock = NULL;
+ }
sfree(sharestate->server_verstring);
sfree(sharestate->sockname);
sfree(sharestate);
@@ -1843,6 +1847,7 @@ static int share_listen_closing(Plug plug, const char *error_msg,
ssh_sharing_logf(sharestate->ssh, 0,
"listening socket: %s", error_msg);
sk_close(sharestate->listensock);
+ sharestate->listensock = NULL;
return 1;
}