mirror of
https://github.com/php/php-src.git
synced 2026-03-31 12:42:29 +02:00
Close open files in case of failure (Amit)
This commit is contained in:
@@ -748,6 +748,13 @@ PHP_FUNCTION(proc_open)
|
||||
}
|
||||
|
||||
if (FALSE == newprocok) {
|
||||
/* clean up all the descriptors */
|
||||
for (i = 0; i < ndesc; i++) {
|
||||
CloseHandle(descriptors[i].childend);
|
||||
if (descriptors[i].parentend) {
|
||||
CloseHandle(descriptors[i].parentend);
|
||||
}
|
||||
}
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "CreateProcess failed");
|
||||
goto exit_fail;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user