diff options
Diffstat (limited to 'src/lib/libcrypto/pem/pem_pkey.c')
| -rw-r--r-- | src/lib/libcrypto/pem/pem_pkey.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pem/pem_pkey.c b/src/lib/libcrypto/pem/pem_pkey.c index 7e5e4f5771..a50742a63d 100644 --- a/src/lib/libcrypto/pem/pem_pkey.c +++ b/src/lib/libcrypto/pem/pem_pkey.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pem_pkey.c,v 1.17 2014/07/11 08:44:49 jsing Exp $ */ | 1 | /* $OpenBSD: pem_pkey.c,v 1.18 2014/07/12 16:03:37 miod 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 | * |
| @@ -99,8 +99,7 @@ PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | |||
| 99 | goto p8err; | 99 | goto p8err; |
| 100 | ret = EVP_PKCS82PKEY(p8inf); | 100 | ret = EVP_PKCS82PKEY(p8inf); |
| 101 | if (x) { | 101 | if (x) { |
| 102 | if (*x) | 102 | EVP_PKEY_free(*x); |
| 103 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 104 | *x = ret; | 103 | *x = ret; |
| 105 | } | 104 | } |
| 106 | PKCS8_PRIV_KEY_INFO_free(p8inf); | 105 | PKCS8_PRIV_KEY_INFO_free(p8inf); |
| @@ -128,8 +127,7 @@ PEM_read_bio_PrivateKey(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u) | |||
| 128 | goto p8err; | 127 | goto p8err; |
| 129 | ret = EVP_PKCS82PKEY(p8inf); | 128 | ret = EVP_PKCS82PKEY(p8inf); |
| 130 | if (x) { | 129 | if (x) { |
| 131 | if (*x) | 130 | EVP_PKEY_free(*x); |
| 132 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 133 | *x = ret; | 131 | *x = ret; |
| 134 | } | 132 | } |
| 135 | PKCS8_PRIV_KEY_INFO_free(p8inf); | 133 | PKCS8_PRIV_KEY_INFO_free(p8inf); |
| @@ -194,8 +192,7 @@ PEM_read_bio_Parameters(BIO *bp, EVP_PKEY **x) | |||
| 194 | goto err; | 192 | goto err; |
| 195 | } | 193 | } |
| 196 | if (x) { | 194 | if (x) { |
| 197 | if (*x) | 195 | EVP_PKEY_free(*x); |
| 198 | EVP_PKEY_free((EVP_PKEY *)*x); | ||
| 199 | *x = ret; | 196 | *x = ret; |
| 200 | } | 197 | } |
| 201 | } | 198 | } |
