diff options
| author | tb <> | 2026-06-22 19:13:53 +0000 |
|---|---|---|
| committer | tb <> | 2026-06-22 19:13:53 +0000 |
| commit | 7d484afcc91aea3502596af49c22451f7f77c7ea (patch) | |
| tree | 23d1dad84e17792135f826a3ee7c89b9454eb8ee /src/lib | |
| parent | 8d6dc05079ae2eaff92293238f56efaaea118fb1 (diff) | |
| download | openbsd-7d484afcc91aea3502596af49c22451f7f77c7ea.tar.gz openbsd-7d484afcc91aea3502596af49c22451f7f77c7ea.tar.bz2 openbsd-7d484afcc91aea3502596af49c22451f7f77c7ea.zip | |
x509_vfy: remove unnecessary NULL checks before free
looks good to claudio
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_vfy.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/x509/x509_vfy.c b/src/lib/libcrypto/x509/x509_vfy.c index db4253f861..f2f86b3447 100644 --- a/src/lib/libcrypto/x509/x509_vfy.c +++ b/src/lib/libcrypto/x509/x509_vfy.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_vfy.c,v 1.150 2026/06/22 09:27:32 tb Exp $ */ | 1 | /* $OpenBSD: x509_vfy.c,v 1.151 2026/06/22 19:13:53 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 | * |
| @@ -1083,17 +1083,14 @@ get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, | |||
| 1083 | } | 1083 | } |
| 1084 | 1084 | ||
| 1085 | if (best_crl) { | 1085 | if (best_crl) { |
| 1086 | if (*pcrl) | 1086 | X509_CRL_free(*pcrl); |
| 1087 | X509_CRL_free(*pcrl); | ||
| 1088 | *pcrl = best_crl; | 1087 | *pcrl = best_crl; |
| 1089 | *pissuer = best_crl_issuer; | 1088 | *pissuer = best_crl_issuer; |
| 1090 | *pscore = best_score; | 1089 | *pscore = best_score; |
| 1091 | *preasons = best_reasons; | 1090 | *preasons = best_reasons; |
| 1092 | CRYPTO_add(&best_crl->references, 1, CRYPTO_LOCK_X509_CRL); | 1091 | CRYPTO_add(&best_crl->references, 1, CRYPTO_LOCK_X509_CRL); |
| 1093 | if (*pdcrl) { | 1092 | X509_CRL_free(*pdcrl); |
| 1094 | X509_CRL_free(*pdcrl); | 1093 | *pdcrl = NULL; |
| 1095 | *pdcrl = NULL; | ||
| 1096 | } | ||
| 1097 | get_delta_sk(ctx, pdcrl, pscore, best_crl, crls); | 1094 | get_delta_sk(ctx, pdcrl, pscore, best_crl, crls); |
| 1098 | } | 1095 | } |
| 1099 | 1096 | ||
