Permalink
Browse files

Fix a BIO leak when verifying SSL certificates or calling get_peer_cert.

  • Loading branch information...
nelhage committed Feb 19, 2013
1 parent d7c8a14 commit b2006a6f4893f35ca8b1b5fc283f3b1e2127bc5c
Showing with 2 additions and 2 deletions.
  1. +1 −1 ext/rubymain.cpp
  2. +1 −1 ext/ssl.cpp
@@ -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
@@ -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 b2006a6

Please sign in to comment.