diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-04-30 16:23:33 +0200 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-01 13:14:49 +0100 |
commit | b2b361f6afb55c501bedef664c1fdc0d71a91d4b (patch) | |
tree | 2678410dc1fd78d2832316a9013104ca7698d23c /crypto/asn1/tasn_utl.c | |
parent | 57358a83a401ef469353b7ebdae0cf3b870a4d5e (diff) |
Raise an Err when CRYPTO_THREAD_lock_new fails
Add missing error raise call, as it is done everywhere else.
and as CRYPTO_THREAD_lock_new don't do it internally.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/asn1/tasn_utl.c')
-rw-r--r-- | crypto/asn1/tasn_utl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/asn1/tasn_utl.c b/crypto/asn1/tasn_utl.c index cb245939c4..f03f9e9ed0 100644 --- a/crypto/asn1/tasn_utl.c +++ b/crypto/asn1/tasn_utl.c @@ -50,6 +50,7 @@ int asn1_set_choice_selector(ASN1_VALUE **pval, int value, * then the count is incremented. If op is 0 count is set to 1. If op is -1 * count is decremented and the return value is the current reference count * or 0 if no reference count exists. + * FIXME: return and manage any error from inside this method */ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) @@ -68,8 +69,10 @@ int asn1_do_lock(ASN1_VALUE **pval, int op, const ASN1_ITEM *it) if (op == 0) { *lck = 1; *lock = CRYPTO_THREAD_lock_new(); - if (*lock == NULL) + if (*lock == NULL) { + /* FIXME: should report an error (-1) at this point */ return 0; + } return 1; } CRYPTO_atomic_add(lck, op, &ret, *lock); |