diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2007-06-19 22:09:49 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2007-06-19 22:09:49 +0000 |
commit | e2b093bfcb7b35f1611edeb2cce6cc9334cb68b1 (patch) | |
tree | 9d5d6c7082aca921d8556daab2d69d8a04c416c4 | |
parent | 332206402532820c78b6d833977f692625220b54 (diff) | |
download | php-git-e2b093bfcb7b35f1611edeb2cce6cc9334cb68b1.tar.gz |
Fixed a memory leak inside load_all_certs_file()
-rw-r--r-- | ext/openssl/openssl.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 10cf462917..c6ee21dd6b 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1109,17 +1109,20 @@ static STACK_OF(X509) * load_all_certs_from_file(char *certfile) } if (php_openssl_safe_mode_chk(certfile TSRMLS_CC)) { + sk_X509_free(stack); goto end; } if(!(in=BIO_new_file(certfile, "r"))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "error opening the file, %s", certfile); + sk_X509_free(stack); goto end; } /* This loads from a file, a stack of x509/crl/pkey sets */ if(!(sk=PEM_X509_INFO_read_bio(in, NULL, NULL, NULL))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "error reading the file, %s", certfile); + sk_X509_free(stack); goto end; } |