diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-30 18:10:52 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-30 18:10:52 -0400 |
commit | 895cba195a0c8430dcc8d1aa22b75eccaaee8f49 (patch) | |
tree | 198a8361064426dbc73c52143123835dfc8017a2 /crypto/srp | |
parent | b0696f8b0b6e9a837e0abe4d79a8219e287c9036 (diff) | |
download | openssl-895cba195a0c8430dcc8d1aa22b75eccaaee8f49.tar.gz |
free cleanup 12
Don't check for NULL before calling free function. This gets:
NAME_CONSTRAINTS_free GENERAL_SUBTREE_free ECDSA_METHOD_free
JPAKE_CTX_free OCSP_REQ_CTX_free SCT_free SRP_VBASE_free
SRP_gN_free SRP_user_pwd_free TXT_DB_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/srp')
-rw-r--r-- | crypto/srp/srp_vfy.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/srp/srp_vfy.c b/crypto/srp/srp_vfy.c index e8bdbf58b1..cd07f702c5 100644 --- a/crypto/srp/srp_vfy.c +++ b/crypto/srp/srp_vfy.c @@ -270,13 +270,14 @@ SRP_VBASE *SRP_VBASE_new(char *seed_key) return vb; } -int SRP_VBASE_free(SRP_VBASE *vb) +void SRP_VBASE_free(SRP_VBASE *vb) { + if (!vb) + return; sk_SRP_user_pwd_pop_free(vb->users_pwd, SRP_user_pwd_free); sk_SRP_gN_cache_free(vb->gN_cache); OPENSSL_free(vb->seed_key); OPENSSL_free(vb); - return 0; } static SRP_gN_cache *SRP_gN_new_init(const char *ch) @@ -457,8 +458,7 @@ int SRP_VBASE_init(SRP_VBASE *vb, char *verifier_file) SRP_user_pwd_free(user_pwd); - if (tmpdb) - TXT_DB_free(tmpdb); + TXT_DB_free(tmpdb); BIO_free_all(in); sk_SRP_gN_free(SRP_gN_tab); @@ -509,7 +509,8 @@ SRP_user_pwd *SRP_VBASE_get_by_user(SRP_VBASE *vb, char *username) BN_bin2bn(digv, SHA_DIGEST_LENGTH, NULL))) return user; - err:SRP_user_pwd_free(user); + err: + SRP_user_pwd_free(user); return NULL; } |