mirror of
https://github.com/php/php-src.git
synced 2025-01-25 21:23:45 +08:00
prevent potential leak on error
This commit is contained in:
parent
e5e9865197
commit
03b68981f9
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user