diff options
author | 2014-04-17 17:11:10 +0000 | |
---|---|---|
committer | 2014-04-17 17:11:10 +0000 | |
commit | 1755f63188d7448c97a63de5f89751bd9855e459 (patch) | |
tree | 23836e4531df35b6e3e6aeff8dad628553b0812c /lib/libssl | |
parent | remove OPENSSL_realloc_clean usage here - replace with intrinsics to make (diff) | |
download | wireguard-openbsd-1755f63188d7448c97a63de5f89751bd9855e459.tar.xz wireguard-openbsd-1755f63188d7448c97a63de5f89751bd9855e459.zip |
fix a potential double free
ok miod@
Diffstat (limited to 'lib/libssl')
-rw-r--r-- | lib/libssl/d1_srvr.c | 4 | ||||
-rw-r--r-- | lib/libssl/src/ssl/d1_srvr.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libssl/d1_srvr.c b/lib/libssl/d1_srvr.c index 9b87dcd0676..ce7b243c2db 100644 --- a/lib/libssl/d1_srvr.c +++ b/lib/libssl/d1_srvr.c @@ -1290,6 +1290,7 @@ dtls1_send_server_key_exchange(SSL *s) (unsigned char *)encodedPoint, encodedlen); free(encodedPoint); + encodedPoint = NULL; p += encodedlen; } #endif @@ -1397,8 +1398,7 @@ f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: #ifndef OPENSSL_NO_ECDH - if (encodedPoint != NULL) - free(encodedPoint); + free(encodedPoint); BN_CTX_free(bn_ctx); #endif EVP_MD_CTX_cleanup(&md_ctx); diff --git a/lib/libssl/src/ssl/d1_srvr.c b/lib/libssl/src/ssl/d1_srvr.c index 9b87dcd0676..ce7b243c2db 100644 --- a/lib/libssl/src/ssl/d1_srvr.c +++ b/lib/libssl/src/ssl/d1_srvr.c @@ -1290,6 +1290,7 @@ dtls1_send_server_key_exchange(SSL *s) (unsigned char *)encodedPoint, encodedlen); free(encodedPoint); + encodedPoint = NULL; p += encodedlen; } #endif @@ -1397,8 +1398,7 @@ f_err: ssl3_send_alert(s, SSL3_AL_FATAL, al); err: #ifndef OPENSSL_NO_ECDH - if (encodedPoint != NULL) - free(encodedPoint); + free(encodedPoint); BN_CTX_free(bn_ctx); #endif EVP_MD_CTX_cleanup(&md_ctx); |