From a6bc3f6c59c9e91c6c1ee6cc31ecc3ae237925cb Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sun, 23 Oct 2011 03:02:24 +0000 Subject: [PATCH] fix memory leak --- NEWS | 2 ++ sapi/cli/php_cli_server.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index 916eba0348..3881b9fce5 100644 --- a/NEWS +++ b/NEWS @@ -3,9 +3,11 @@ PHP NEWS ?? ??? 2011, PHP 5.4.0 RC1 - General improvements: . Changed silent conversion of array to string to produce a notice. (Patrick) + - CLI SAPI: . Fixed bug #60112 (If URI does not contain a file, index.php is not served) .(Laruence) + . Fixed bug #60115 (memory definitely lost in cli server). (Laruence) 20 Oct 2011, PHP 5.4.0 beta2 - General improvements: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 52e77db821..aaa17df17e 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1787,6 +1787,9 @@ static int php_cli_server_send_error_page(php_cli_server *server, php_cli_server php_cli_server_log_response(client, status, errstr ? errstr : "?" TSRMLS_CC); php_cli_server_poller_add(&server->poller, POLLOUT, client->sock); + if (errstr) { + pefree(errstr, 1); + } efree(escaped_request_uri); return SUCCESS; -- 2.50.1