diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-03-07 22:45:58 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-16 10:17:33 +0100 |
commit | c5ebfcab713a82a1d46a51c8c2668c419425b387 (patch) | |
tree | ca8da99a90b24c37c37ce417ad02c1f35e1e1735 /crypto/x509/x509_lu.c | |
parent | 592b6fb489c97be2b039ab671647aa58a472204a (diff) | |
download | openssl-c5ebfcab713a82a1d46a51c8c2668c419425b387.tar.gz |
Unify <TYPE>_up_ref methods signature and behaviour.
Add a status return value instead of void.
Add some sanity checks on reference counter value.
Update the docs.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/x509/x509_lu.c')
-rw-r--r-- | crypto/x509/x509_lu.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/x509/x509_lu.c b/crypto/x509/x509_lu.c index c4ca619d8c..3a8c657b85 100644 --- a/crypto/x509/x509_lu.c +++ b/crypto/x509/x509_lu.c @@ -417,18 +417,17 @@ int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x) return ret; } -void X509_OBJECT_up_ref_count(X509_OBJECT *a) +int X509_OBJECT_up_ref_count(X509_OBJECT *a) { switch (a->type) { default: break; case X509_LU_X509: - X509_up_ref(a->data.x509); - break; + return X509_up_ref(a->data.x509); case X509_LU_CRL: - X509_CRL_up_ref(a->data.crl); - break; + return X509_CRL_up_ref(a->data.crl); } + return 1; } X509 *X509_OBJECT_get0_X509(X509_OBJECT *a) |