diff options
| author | tb <> | 2023-12-25 21:33:50 +0000 |
|---|---|---|
| committer | tb <> | 2023-12-25 21:33:50 +0000 |
| commit | 9afda644b2b2ec265deb909541bed51cd55ab317 (patch) | |
| tree | 25628447dd6b8b89f6081cba5e619cf50d1a38ae /src | |
| parent | 6e7800cae6c43600e7cd9f82d4a05ee8bba24daf (diff) | |
| download | openbsd-9afda644b2b2ec265deb909541bed51cd55ab317.tar.gz openbsd-9afda644b2b2ec265deb909541bed51cd55ab317.tar.bz2 openbsd-9afda644b2b2ec265deb909541bed51cd55ab317.zip | |
Rework evp_pkey_free_pkey_ptr()
Rename the variable from x into pkey, make it NULL safe and unindent.
ok jsing
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/evp/p_lib.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c index 9fc45714ed..b4f6490640 100644 --- a/src/lib/libcrypto/evp/p_lib.c +++ b/src/lib/libcrypto/evp/p_lib.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: p_lib.c,v 1.43 2023/12/25 21:31:58 tb Exp $ */ | 1 | /* $OpenBSD: p_lib.c,v 1.44 2023/12/25 21:33:50 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 | * |
| @@ -215,12 +215,13 @@ EVP_PKEY_up_ref(EVP_PKEY *pkey) | |||
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | static void | 217 | static void |
| 218 | evp_pkey_free_pkey_ptr(EVP_PKEY *x) | 218 | evp_pkey_free_pkey_ptr(EVP_PKEY *pkey) |
| 219 | { | 219 | { |
| 220 | if (x->ameth && x->ameth->pkey_free) { | 220 | if (pkey == NULL || pkey->ameth == NULL || pkey->ameth->pkey_free == NULL) |
| 221 | x->ameth->pkey_free(x); | 221 | return; |
| 222 | x->pkey.ptr = NULL; | 222 | |
| 223 | } | 223 | pkey->ameth->pkey_free(pkey); |
| 224 | pkey->pkey.ptr = NULL; | ||
| 224 | } | 225 | } |
| 225 | 226 | ||
| 226 | /* Setup a public key ASN1 method from a NID or a string. | 227 | /* Setup a public key ASN1 method from a NID or a string. |
