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