diff options
author | Rich Salz <rsalz@akamai.com> | 2016-01-30 12:04:25 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-11 12:40:32 -0500 |
commit | f3f1cf8444f439c0be9de04bf3821a20d00fd956 (patch) | |
tree | 50d0fc624d4680e6cd734328126cd60a9dc128be /crypto/engine | |
parent | 7823d792d0cad3b44ad5389a8d3381becefe7f44 (diff) |
Move to REF_DEBUG, for consistency.
Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/engine')
-rw-r--r-- | crypto/engine/eng_init.c | 7 | ||||
-rw-r--r-- | crypto/engine/eng_lib.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c index c5f3805765..b66d476d80 100644 --- a/crypto/engine/eng_init.c +++ b/crypto/engine/eng_init.c @@ -108,12 +108,7 @@ int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers) if (!to_return) return 0; } -#ifdef REF_CHECK - if (e->funct_ref < 0) { - fprintf(stderr, "ENGINE_finish, bad functional reference count\n"); - abort(); - } -#endif + REF_ASSERT_ISNT(e->funct_ref < 0); /* Release the structural reference too */ if (!engine_free_util(e, 0)) { ENGINEerr(ENGINE_F_ENGINE_UNLOCKED_FINISH, ENGINE_R_FINISH_FAILED); diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c index 388e8ca877..15c2c6ff68 100644 --- a/crypto/engine/eng_lib.c +++ b/crypto/engine/eng_lib.c @@ -114,12 +114,7 @@ int engine_free_util(ENGINE *e, int locked) engine_ref_debug(e, 0, -1) if (i > 0) return 1; -#ifdef REF_CHECK - if (i < 0) { - fprintf(stderr, "ENGINE_free, bad structural reference count\n"); - abort(); - } -#endif + REF_ASSERT_ISNT(i < 0); /* Free up any dynamically allocated public key methods */ engine_pkey_meths_free(e); engine_pkey_asn1_meths_free(e); |