diff options
author | tb <> | 2022-11-19 04:36:52 +0000 |
---|---|---|
committer | tb <> | 2022-11-19 04:36:52 +0000 |
commit | 0212ee709462b3ddc8d36dea8c8c1dfe034a39b0 (patch) | |
tree | 1e7b17f06915ef0908b5dee01d80859a8c922073 /src | |
parent | 20f343279cc3fa9330806f533c4e43196fca6f81 (diff) | |
download | openbsd-0212ee709462b3ddc8d36dea8c8c1dfe034a39b0.tar.gz openbsd-0212ee709462b3ddc8d36dea8c8c1dfe034a39b0.tar.bz2 openbsd-0212ee709462b3ddc8d36dea8c8c1dfe034a39b0.zip |
Unindent and check some pointers explicitly against NULL
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/hmac/hm_ameth.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c index dfd7169ba0..5b52af658c 100644 --- a/src/lib/libcrypto/hmac/hm_ameth.c +++ b/src/lib/libcrypto/hmac/hm_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hm_ameth.c,v 1.17 2022/11/19 04:32:49 tb Exp $ */ | 1 | /* $OpenBSD: hm_ameth.c,v 1.18 2022/11/19 04:36:52 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2007. | 3 | * project 2007. |
4 | */ | 4 | */ |
@@ -84,13 +84,15 @@ hmac_size(const EVP_PKEY *pkey) | |||
84 | static void | 84 | static void |
85 | hmac_key_free(EVP_PKEY *pkey) | 85 | hmac_key_free(EVP_PKEY *pkey) |
86 | { | 86 | { |
87 | ASN1_OCTET_STRING *os = pkey->pkey.ptr; | 87 | ASN1_OCTET_STRING *os; |
88 | 88 | ||
89 | if (os) { | 89 | if ((os = pkey->pkey.ptr) == NULL) |
90 | if (os->data) | 90 | return; |
91 | explicit_bzero(os->data, os->length); | 91 | |
92 | ASN1_OCTET_STRING_free(os); | 92 | if (os->data != NULL) |
93 | } | 93 | explicit_bzero(os->data, os->length); |
94 | |||
95 | ASN1_OCTET_STRING_free(os); | ||
94 | } | 96 | } |
95 | 97 | ||
96 | static int | 98 | static int |