summaryrefslogtreecommitdiffstats
path: root/libssh/dh.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/dh.c')
-rw-r--r--libssh/dh.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/libssh/dh.c b/libssh/dh.c
index b77aff9..625fd05 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