summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh_lib.c
diff options
context:
space:
mode:
authortb <>2024-03-27 01:22:30 +0000
committertb <>2024-03-27 01:22:30 +0000
commit34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8 (patch)
treec0c42a2b8c4163dc6824836c943bda44cac3d87e /src/lib/libcrypto/dh/dh_lib.c
parent71e785c49d7143edbfb309d799e532de7857e689 (diff)
downloadopenbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.tar.gz
openbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.tar.bz2
openbsd-34e2ca7d2d0a0fb4722dfa5e884d5657ea45d8f8.zip
Unify *_up_ref() implementations
No need for an inconsistently named local variable and a ternary operator. ok jsing
Diffstat (limited to 'src/lib/libcrypto/dh/dh_lib.c')
-rw-r--r--src/lib/libcrypto/dh/dh_lib.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/dh/dh_lib.c b/src/lib/libcrypto/dh/dh_lib.c
index d8698859f0..98cc6e77ba 100644
--- a/src/lib/libcrypto/dh/dh_lib.c
+++ b/src/lib/libcrypto/dh/dh_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh_lib.c,v 1.43 2023/11/29 21:35:57 tb Exp $ */ 1/* $OpenBSD: dh_lib.c,v 1.44 2024/03/27 01:22:30 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -170,9 +170,7 @@ LCRYPTO_ALIAS(DH_free);
170int 170int
171DH_up_ref(DH *r) 171DH_up_ref(DH *r)
172{ 172{
173 int i = CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH); 173 return CRYPTO_add(&r->references, 1, CRYPTO_LOCK_DH) > 1;
174
175 return i > 1 ? 1 : 0;
176} 174}
177LCRYPTO_ALIAS(DH_up_ref); 175LCRYPTO_ALIAS(DH_up_ref);
178 176