From b246356ab50a080c687d0130841d8f533abe0d44 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 16 Apr 2009 14:18:09 +0000 Subject: Improve ssh_crypto_finalize(). git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@496 7dcaeef0-15fb-0310-b436-a5af3365683c --- libssh/dh.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'libssh/dh.c') diff --git a/libssh/dh.c b/libssh/dh.c index b77aff92..625fd05a 100644 --- a/libssh/dh.c +++ b/libssh/dh.c @@ -139,14 +139,16 @@ int ssh_crypto_init(void) { return 0; } -void ssh_crypto_finalize(void){ - if(ssh_crypto_inited){ - bignum_free(g); - bignum_free(p); - ssh_crypto_inited=0; - } +void ssh_crypto_finalize(void) { + if(ssh_crypto_inited) { + bignum_free(g); + g = NULL; + bignum_free(p); + p = NULL; + ssh_crypto_inited = 0; + } } - + /* prints the bignum on stderr */ void ssh_print_bignum(const char *which,bignum num){ #ifdef HAVE_LIBGCRYPT -- cgit