summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-04-16 14:18:09 +0000
committerAndreas Schneider <mail@cynapses.org>2009-04-16 14:18:09 +0000
commitb246356ab50a080c687d0130841d8f533abe0d44 (patch)
tree1a875c7461f6276c6a39891b6eab260f21a52a3c
parent8f150afeeb57302aca4fb4b89ae91d070d1f661f (diff)
downloadlibssh-b246356ab50a080c687d0130841d8f533abe0d44.tar.gz
libssh-b246356ab50a080c687d0130841d8f533abe0d44.tar.xz
libssh-b246356ab50a080c687d0130841d8f533abe0d44.zip
Improve ssh_crypto_finalize().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@496 7dcaeef0-15fb-0310-b436-a5af3365683c
-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