From 4f4e917187742e033db8d1888734e7492ddd208b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 9 Dec 2013 19:49:54 +0100 Subject: [PATCH] bind: Correctly free all memory in ssh_bind_free(). Thanks to Jacob Baines. --- src/bind.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bind.c b/src/bind.c index 8132e3e9..c8306da3 100644 --- a/src/bind.c +++ b/src/bind.c @@ -341,11 +341,15 @@ void ssh_bind_free(ssh_bind sshbind){ /* options */ SAFE_FREE(sshbind->banner); + SAFE_FREE(sshbind->bindaddr); + SAFE_FREE(sshbind->dsakey); SAFE_FREE(sshbind->rsakey); - SAFE_FREE(sshbind->dsa); - SAFE_FREE(sshbind->rsa); - SAFE_FREE(sshbind->bindaddr); + SAFE_FREE(sshbind->ecdsakey); + + ssh_key_free(sshbind->dsa); + ssh_key_free(sshbind->rsa); + ssh_key_free(sshbind->ecdsa); for (i = 0; i < 10; i++) { if (sshbind->wanted_methods[i]) {