diff options
| author | mmcc <> | 2016-03-11 07:08:45 +0000 |
|---|---|---|
| committer | mmcc <> | 2016-03-11 07:08:45 +0000 |
| commit | 13f852f88b7f59607c91ef9ac8a34ae4e55e08ca (patch) | |
| tree | b799fc9672743546b69747e9e1d53d9423de380c /src/lib/libcrypto/pkcs12 | |
| parent | e11a59757e997c4effb65f1ad3aa27df9dff42f5 (diff) | |
| download | openbsd-13f852f88b7f59607c91ef9ac8a34ae4e55e08ca.tar.gz openbsd-13f852f88b7f59607c91ef9ac8a34ae4e55e08ca.tar.bz2 openbsd-13f852f88b7f59607c91ef9ac8a34ae4e55e08ca.zip | |
X509_free(3) is NULL-safe, so remove NULL checks before its calls.
ok doug@
Diffstat (limited to 'src/lib/libcrypto/pkcs12')
| -rw-r--r-- | src/lib/libcrypto/pkcs12/p12_kiss.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c index eaaa2bc911..df992a68fc 100644 --- a/src/lib/libcrypto/pkcs12/p12_kiss.c +++ b/src/lib/libcrypto/pkcs12/p12_kiss.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: p12_kiss.c,v 1.16 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: p12_kiss.c,v 1.17 2016/03/11 07:08:44 mmcc 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 1999. | 3 | * project 1999. |
| 4 | */ | 4 | */ |
| @@ -149,8 +149,7 @@ PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | |||
| 149 | goto err; | 149 | goto err; |
| 150 | x = NULL; | 150 | x = NULL; |
| 151 | } | 151 | } |
| 152 | if (x) | 152 | X509_free(x); |
| 153 | X509_free(x); | ||
| 154 | } | 153 | } |
| 155 | 154 | ||
| 156 | if (ocerts) | 155 | if (ocerts) |
| @@ -161,10 +160,9 @@ PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | |||
| 161 | err: | 160 | err: |
| 162 | if (pkey && *pkey) | 161 | if (pkey && *pkey) |
| 163 | EVP_PKEY_free(*pkey); | 162 | EVP_PKEY_free(*pkey); |
| 164 | if (cert && *cert) | 163 | if (cert) |
| 165 | X509_free(*cert); | 164 | X509_free(*cert); |
| 166 | if (x) | 165 | X509_free(x); |
| 167 | X509_free(x); | ||
| 168 | if (ocerts) | 166 | if (ocerts) |
| 169 | sk_X509_pop_free(ocerts, X509_free); | 167 | sk_X509_pop_free(ocerts, X509_free); |
| 170 | return 0; | 168 | return 0; |
