diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-01-06 02:39:24 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-01-06 02:39:24 +0100 |
commit | ad65ce755ea292df565a50e730e4210a3e732f4e (patch) | |
tree | 3935dd7109ea178fb4d9e6b5061ab51cffaa08ba /crypto/dh | |
parent | Free the right thing. (diff) | |
download | openssl-ad65ce755ea292df565a50e730e4210a3e732f4e.tar.xz openssl-ad65ce755ea292df565a50e730e4210a3e732f4e.zip |
Fix things so DH_free() will be no-op when passed NULL, like RSA_free() and
DSA_free(): this was causing crashes when for example an attempt was made
to handle a (currently) unsupported DH public key. Also X509_PUBKEY_set()i
wasn't checking errors from d2i_PublicKey().
Diffstat (limited to 'crypto/dh')
-rw-r--r-- | crypto/dh/dh_lib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index a83c97287e..725d994702 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -88,6 +88,7 @@ DH *DH_new() void DH_free(r) DH *r; { + if(r == NULL) return; if (r->p != NULL) BN_clear_free(r->p); if (r->g != NULL) BN_clear_free(r->g); if (r->pub_key != NULL) BN_clear_free(r->pub_key); |