pajoye Fri May 26 01:48:23 2006 UTC
Modified files:
/php-src/ext/openssl xp_ssl.c
Log:
- MFB: fix leaks in openssl context options
http://cvs.php.net/viewcvs.cgi/php-src/ext/openssl/xp_ssl.c?r1=1.25&r2=1.26&diff_format=u
Index: php-src/ext/openssl/xp_ssl.c
diff -u php-src/ext/openssl/xp_ssl.c:1.25 php-src/ext/openssl/xp_ssl.c:1.26
--- php-src/ext/openssl/xp_ssl.c:1.25 Sun Apr 30 23:45:13 2006
+++ php-src/ext/openssl/xp_ssl.c Fri May 26 01:48:23 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_ssl.c,v 1.25 2006/04/30 23:45:13 wez Exp $ */
+/* $Id: xp_ssl.c,v 1.26 2006/05/26 01:48:23 pajoye Exp $ */
#include "php.h"
#include "ext/standard/file.h"
@@ -432,6 +432,7 @@
"ssl",
"peer_certificate",
zcert);
peer_cert = NULL;
+ efree(zcert);
}
if (SUCCESS ==
php_stream_context_get_option(
@@ -445,7 +446,7 @@
chain = SSL_get_peer_cert_chain(
sslsock->ssl_handle);
- if (chain) {
+ if (chain && sk_X509_num(chain)
> 0) {
int i;
array_init(arr);
@@ -458,6 +459,7 @@
php_openssl_get_x509_list_id()));
add_next_index_zval(arr, zcert);
}
+ efree(zcert);
} else {
ZVAL_NULL(arr);
}
@@ -465,6 +467,8 @@
php_stream_context_set_option(stream->context,
"ssl",
"peer_certificate_chain",
arr);
+ zval_dtor(arr);
+ efree(arr);
}
}
}-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
