Skip to content

Commit

Permalink
Free cert in php_openssl_load_stream_cafile()
Browse files Browse the repository at this point in the history
X509_STORE_add_cert() increments the refcount of the cert, so we
should free it here.
  • Loading branch information
nikic committed Jun 21, 2019
1 parent fea9f93 commit 90cb374
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ext/openssl/xp_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ static long php_openssl_load_stream_cafile(X509_STORE *cert_store, const char *c
buffer_active = 0;
if (cert && X509_STORE_add_cert(cert_store, cert)) {
++certs_added;
X509_free(cert);
}
goto cert_start;
}
Expand Down

0 comments on commit 90cb374

Please sign in to comment.