From d46ebde52825d78e3a771c3afe3c837dd13d3039 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Thu, 2 Dec 2004 13:37:28 +0000 Subject: [PATCH] NULL a couple of members after freeing them in ssh_free(). In particular, should stop ssh_do_close() accessing freed ssh->channels when invoked later from ssh_free(). Spotted by Fred Sauer. (Perhaps this is the cause of the crashes people have been reporting on abnormal closures such as `Software caused connection abort'? I've not been able to test this.) [originally from svn r4946] --- ssh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssh.c b/ssh.c index e0facac1..8c552b1e 100644 --- a/ssh.c +++ b/ssh.c @@ -7235,12 +7235,14 @@ static void ssh_free(void *handle) sfree(c); } freetree234(ssh->channels); + ssh->channels = NULL; } if (ssh->rportfwds) { while ((pf = delpos234(ssh->rportfwds, 0)) != NULL) sfree(pf); freetree234(ssh->rportfwds); + ssh->rportfwds = NULL; } sfree(ssh->deferred_send_data); if (ssh->x11auth)