diff options
author | jsing <> | 2014-06-07 14:10:35 +0000 |
---|---|---|
committer | jsing <> | 2014-06-07 14:10:35 +0000 |
commit | f343af817aa3c5121ccee178feb8ac0fa700172b (patch) | |
tree | 827d5a799fe09599039564d7a3a27bf8ba15a731 /src/lib/libssl/d1_clnt.c | |
parent | 8e572c76ea1f88213041d8394aa478381641e07c (diff) | |
download | openbsd-f343af817aa3c5121ccee178feb8ac0fa700172b.tar.gz openbsd-f343af817aa3c5121ccee178feb8ac0fa700172b.tar.bz2 openbsd-f343af817aa3c5121ccee178feb8ac0fa700172b.zip |
The DH_free, EC_KEY_free, EVP_PKEY_free and RSA_free functions all have
implicit NULL checks, so there is no point ensuring that the pointer is
non-NULL before calling them.
Diffstat (limited to 'src/lib/libssl/d1_clnt.c')
-rw-r--r-- | src/lib/libssl/d1_clnt.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lib/libssl/d1_clnt.c b/src/lib/libssl/d1_clnt.c index ef4a74e0af..8ff4d8e369 100644 --- a/src/lib/libssl/d1_clnt.c +++ b/src/lib/libssl/d1_clnt.c | |||
@@ -1211,8 +1211,7 @@ dtls1_send_client_key_exchange(SSL *s) | |||
1211 | /* Free allocated memory */ | 1211 | /* Free allocated memory */ |
1212 | BN_CTX_free(bn_ctx); | 1212 | BN_CTX_free(bn_ctx); |
1213 | free(encodedPoint); | 1213 | free(encodedPoint); |
1214 | if (clnt_ecdh != NULL) | 1214 | EC_KEY_free(clnt_ecdh); |
1215 | EC_KEY_free(clnt_ecdh); | ||
1216 | EVP_PKEY_free(srvr_pub_pkey); | 1215 | EVP_PKEY_free(srvr_pub_pkey); |
1217 | } | 1216 | } |
1218 | 1217 | ||
@@ -1321,11 +1320,11 @@ psk_err: | |||
1321 | 1320 | ||
1322 | /* SSL3_ST_CW_KEY_EXCH_B */ | 1321 | /* SSL3_ST_CW_KEY_EXCH_B */ |
1323 | return (dtls1_do_write(s, SSL3_RT_HANDSHAKE)); | 1322 | return (dtls1_do_write(s, SSL3_RT_HANDSHAKE)); |
1323 | |||
1324 | err: | 1324 | err: |
1325 | BN_CTX_free(bn_ctx); | 1325 | BN_CTX_free(bn_ctx); |
1326 | free(encodedPoint); | 1326 | free(encodedPoint); |
1327 | if (clnt_ecdh != NULL) | 1327 | EC_KEY_free(clnt_ecdh); |
1328 | EC_KEY_free(clnt_ecdh); | ||
1329 | EVP_PKEY_free(srvr_pub_pkey); | 1328 | EVP_PKEY_free(srvr_pub_pkey); |
1330 | return (-1); | 1329 | return (-1); |
1331 | } | 1330 | } |
@@ -1447,8 +1446,7 @@ dtls1_send_client_certificate(SSL *s) | |||
1447 | 1446 | ||
1448 | if (x509 != NULL) | 1447 | if (x509 != NULL) |
1449 | X509_free(x509); | 1448 | X509_free(x509); |
1450 | if (pkey != NULL) | 1449 | EVP_PKEY_free(pkey); |
1451 | EVP_PKEY_free(pkey); | ||
1452 | if (i == 0) { | 1450 | if (i == 0) { |
1453 | if (s->version == SSL3_VERSION) { | 1451 | if (s->version == SSL3_VERSION) { |
1454 | s->s3->tmp.cert_req = 0; | 1452 | s->s3->tmp.cert_req = 0; |