Permalink
Browse files

Merge pull request #403 from nelhage/ssl-leak

Fix a BIO leak when verifying SSL certificates or calling get_peer_cert.
  • Loading branch information...
2 parents d7c8a14 + b2006a6 commit 016800f60bd1ec1894fd73ccd0c2634f5fabc1c9 @tmm1 tmm1 committed Feb 19, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 ext/rubymain.cpp
  2. +1 −1 ext/ssl.cpp
View
@@ -332,7 +332,7 @@ static VALUE t_get_peer_cert (VALUE self, VALUE signature)
BIO_get_mem_ptr(out, &buf);
ret = rb_str_new(buf->data, buf->length);
X509_free(cert);
- BUF_MEM_free(buf);
+ BIO_free(out);
}
#endif
View
@@ -459,7 +459,7 @@ extern "C" int ssl_verify_wrapper(int preverify_ok, X509_STORE_CTX *ctx)
ConnectionDescriptor *cd = dynamic_cast <ConnectionDescriptor*> (Bindable_t::GetObject(binding));
result = (cd->VerifySslPeer(buf->data) == true ? 1 : 0);
- BUF_MEM_free(buf);
+ BIO_free(out);
return result;
}

0 comments on commit 016800f

Please sign in to comment.