diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-06-27 21:57:58 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-07-05 17:45:50 +0100 |
commit | 68efafc513788863339c199d22048ef275832094 (patch) | |
tree | 2a409883db3b7f56d4571d77735c964bed640669 /crypto/evp | |
parent | c2d551c01930df54bce6517cfecd214db6e98e80 (diff) |
Add checks on sk_TYPE_push() returned value
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/evp_pbe.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c index 623f447387..ce7aa2cfa1 100644 --- a/crypto/evp/evp_pbe.c +++ b/crypto/evp/evp_pbe.c @@ -173,7 +173,10 @@ int EVP_PBE_alg_add_type(int pbe_type, int pbe_nid, int cipher_nid, pbe_tmp->md_nid = md_nid; pbe_tmp->keygen = keygen; - sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp); + if (!sk_EVP_PBE_CTL_push(pbe_algs, pbe_tmp)) { + OPENSSL_free(pbe_tmp); + goto err; + } return 1; err: |