From: Antony Dovgal Date: Thu, 21 Dec 2006 00:43:00 +0000 (+0000) Subject: prevent potential leak on error X-Git-Tag: RELEASE_1_0_0RC1~589 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03b68981f911d8127995a545bb95414796591487;p=php prevent potential leak on error --- diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 2793494b83..f4773ba637 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -484,6 +484,12 @@ static void cli_register_file_handles(TSRMLS_D) s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); if (s_in==NULL || s_out==NULL || s_err==NULL) { + FREE_ZVAL(zin); + FREE_ZVAL(zout); + FREE_ZVAL(zerr); + if (s_in) php_stream_close(s_in); + if (s_out) php_stream_close(s_out); + if (s_err) php_stream_close(s_err); return; }