From: Dmitry Stogov Date: Tue, 9 Jan 2007 16:27:32 +0000 (+0000) Subject: Close open files in case of failure (Amit) X-Git-Tag: RELEASE_1_0_0RC1~333 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=113aa2339de35ce4fe7d1e045ffe08afdb7232e6;p=php Close open files in case of failure (Amit) --- diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 2648dfbb2b..7a97599e51 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -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; }