diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-12-09 13:38:05 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-12-09 13:38:05 +0000 |
commit | fdb2c6e4e5b8c2065a289bca879820ea61a3c636 (patch) | |
tree | 967357e36692689f2eab5b9daf763cd21674be46 /crypto/x509/x509_lu.c | |
parent | 7661ccadf0f5251eb525a1dfdaed22bc406c823a (diff) |
PR: 2124
Submitted by: Jan Pechanec <Jan.Pechanec@Sun.COM>
Check for memory allocation failures.
Diffstat (limited to 'crypto/x509/x509_lu.c')
-rw-r--r-- | crypto/x509/x509_lu.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index fb7d23bbd0..7e38544e5f 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -200,7 +200,13 @@ X509_STORE *X509_STORE_new(void) ret->lookup_crls = 0; ret->cleanup = 0; - CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data); + if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_X509_STORE, ret, &ret->ex_data)) + { + sk_X509_OBJECT_free(ret->objs); + OPENSSL_free(ret); + return NULL; + } + ret->references=1; return ret; } |