| Index: runtime/bin/secure_socket.cc
|
| diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
|
| index af90fabb7c4759cbc8c9f426722feb42ad115a3a..c75d65e1bf14f86bbf0f3931dab43638bb82718a 100644
|
| --- a/runtime/bin/secure_socket.cc
|
| +++ b/runtime/bin/secure_socket.cc
|
| @@ -899,11 +899,9 @@ void SSLFilter::Connect(const char* hostname,
|
| X509_V_FLAG_PARTIAL_CHAIN |
|
| X509_V_FLAG_TRUSTED_FIRST);
|
| X509_VERIFY_PARAM_set_hostflags(certificate_checking_parameters, 0);
|
| - X509_VERIFY_PARAM_set1_host(certificate_checking_parameters,
|
| - hostname_, strlen(hostname_));
|
| - // TODO(24225) Check return value of set1_host().
|
| - // TODO(24186) free hostname_ if it is not freed when SSL is destroyed.
|
| - // otherwise, make it a local variable, not a instance field.
|
| + status = X509_VERIFY_PARAM_set1_host(certificate_checking_parameters,
|
| + hostname_, strlen(hostname_));
|
| + CheckStatus(status, "Set hostname for certificate checking", __LINE__);
|
| }
|
| // Make the connection:
|
| if (is_server_) {
|
| @@ -1044,6 +1042,10 @@ void SSLFilter::Destroy() {
|
| BIO_free(socket_side_);
|
| socket_side_ = NULL;
|
| }
|
| + if (hostname_ != NULL) {
|
| + free(hostname_);
|
| + hostname_ = NULL;
|
| + }
|
| for (int i = 0; i < kNumBuffers; ++i) {
|
| Dart_DeletePersistentHandle(dart_buffer_objects_[i]);
|
| delete[] buffers_[i];
|
|
|