prevent potential leak on error

This commit is contained in:
Antony Dovgal 2006-12-21 00:43:00 +00:00
parent e5e9865197
commit 03b68981f9

View File

@ -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;
}