From d04408425abcc2bbf2b03e6488d2a3c26cf571d6 Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Wed, 18 Jan 2012 13:15:44 +0100 Subject: [PATCH] de-fatal packet_close(): cipher_cleanup() send and receive context even if cleanup for the first fails --- ssh/packet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ssh/packet.c b/ssh/packet.c index be3f3e4..85ea61c 100644 --- a/ssh/packet.c +++ b/ssh/packet.c @@ -661,9 +661,10 @@ ssh_packet_close(struct ssh *ssh) inflateEnd(stream); } } - if ((r = cipher_cleanup(&state->send_context)) != 0 || - (r = cipher_cleanup(&state->receive_context)) != 0) - fatal("%s: cipher_cleanup failed: %s", __func__, ssh_err(r)); + if ((r = cipher_cleanup(&state->send_context)) != 0) + error("%s: cipher_cleanup failed: %s", __func__, ssh_err(r)); + if ((r = cipher_cleanup(&state->receive_context)) != 0) + error("%s: cipher_cleanup failed: %s", __func__, ssh_err(r)); } /* Sets remote side protocol flags. */