summaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/dh/dh_lib.c')
-rw-r--r--crypto/dh/dh_lib.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c
index 013008eafe..9167d69ea8 100644
--- a/crypto/dh/dh_lib.c
+++ b/crypto/dh/dh_lib.c
@@ -157,17 +157,10 @@ void DH_free(DH *r)
if (r == NULL)
return;
i = CRYPTO_add(&r->references, -1, CRYPTO_LOCK_DH);
-#ifdef REF_PRINT
- REF_PRINT("DH", r);
-#endif
+ REF_PRINT_COUNT("DH", r);
if (i > 0)
return;
-#ifdef REF_CHECK
- if (i < 0) {
- fprintf(stderr, "DH_free, bad reference count\n");
- abort();
- }
-#endif
+ REF_ASSERT_ISNT(i < 0);
if (r->meth->finish)
r->meth->finish(r);
@@ -192,15 +185,9 @@ void DH_free(DH *r)
int DH_up_ref(DH *r)
{
int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH);
-#ifdef REF_PRINT
- REF_PRINT("DH", r);
-#endif
-#ifdef REF_CHECK
- if (i < 2) {
- fprintf(stderr, "DH_up, bad reference count\n");
- abort();
- }
-#endif
+
+ REF_PRINT_COUNT("DH", r);
+ REF_ASSERT_ISNT(i < 2);
return ((i > 1) ? 1 : 0);
}