diff options
author | tedu <> | 2014-07-09 22:55:17 +0000 |
---|---|---|
committer | tedu <> | 2014-07-09 22:55:17 +0000 |
commit | 5ec69e74aa00653b339f3f526529cd3c926c657a (patch) | |
tree | 1abb2b63f090ef7e75fd385ebcb478b3f21f5c06 /src/lib/libcrypto/dh | |
parent | 555f9c8f48cb40e936e75dc7774680f7ba3e608d (diff) | |
download | openbsd-5ec69e74aa00653b339f3f526529cd3c926c657a.tar.gz openbsd-5ec69e74aa00653b339f3f526529cd3c926c657a.tar.bz2 openbsd-5ec69e74aa00653b339f3f526529cd3c926c657a.zip |
ASN1_STRING_free can handle NULL, so callers don't need to check. ok miod
Diffstat (limited to 'src/lib/libcrypto/dh')
-rw-r--r-- | src/lib/libcrypto/dh/dh_ameth.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/libcrypto/dh/dh_ameth.c b/src/lib/libcrypto/dh/dh_ameth.c index 9e911c8779..21714bb748 100644 --- a/src/lib/libcrypto/dh/dh_ameth.c +++ b/src/lib/libcrypto/dh/dh_ameth.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dh_ameth.c,v 1.9 2014/07/09 13:26:47 miod Exp $ */ | 1 | /* $OpenBSD: dh_ameth.c,v 1.10 2014/07/09 22:55:17 tedu 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 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -167,8 +167,7 @@ dh_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) | |||
167 | 167 | ||
168 | err: | 168 | err: |
169 | free(penc); | 169 | free(penc); |
170 | if (str) | 170 | ASN1_STRING_free(str); |
171 | ASN1_STRING_free(str); | ||
172 | 171 | ||
173 | return 0; | 172 | return 0; |
174 | } | 173 | } |
@@ -271,10 +270,8 @@ dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) | |||
271 | 270 | ||
272 | err: | 271 | err: |
273 | free(dp); | 272 | free(dp); |
274 | if (params != NULL) | 273 | ASN1_STRING_free(params); |
275 | ASN1_STRING_free(params); | 274 | ASN1_INTEGER_free(prkey); |
276 | if (prkey != NULL) | ||
277 | ASN1_INTEGER_free(prkey); | ||
278 | return 0; | 275 | return 0; |
279 | } | 276 | } |
280 | 277 | ||