1
0
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:
Dmitry Stogov
2007-01-09 16:27:32 +00:00
parent 158ec65ba2
commit 113aa2339d

View File

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