Browse Source

Set DH parameters to NULL on shutdown

If we don't do this, we will use freed memory on restart.

Part of 24581.
Nick Mathewson 6 years ago
parent
commit
06ffafcb9d
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/common/crypto.c

+ 2 - 0
src/common/crypto.c

@@ -3470,6 +3470,8 @@ crypto_global_cleanup(void)
   if (dh_param_g)
     BN_clear_free(dh_param_g);
 
+  dh_param_p = dh_param_p_tls = dh_param_g = NULL;
+
 #ifndef DISABLE_ENGINES
   ENGINE_cleanup();
 #endif