summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2006-12-31 15:27:13 +0000
committerNuno Lopes <nlopess@php.net>2006-12-31 15:27:13 +0000
commit169b20753287b203feceacdd564025fafa105532 (patch)
treedf0ea21ae8964ed156dc1be69a609034c7574896
parent877ee656224faf7b1dfc69b4af3740fa8c89d7c1 (diff)
downloadphp-git-169b20753287b203feceacdd564025fafa105532.tar.gz
- Fixed bug #36427 (proc_open() / proc_close() leak handles on windows).
-rw-r--r--NEWS2
-rw-r--r--ext/standard/proc_open.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 5cd9da4a47..b334edefc5 100644
--- a/NEWS
+++ b/NEWS
@@ -51,6 +51,8 @@ PHP NEWS
- Fixed bug #38542 (proc_get_status() returns wrong PID on windows). (Nuno)
- Fixed bug #37588 (COM Property propputref converts to PHP function
and can't be accesed). (Rob)
+- Fixed bug #36427 (proc_open() / proc_close() leak handles on windows).
+ (jdolecek at NetBSD dot org, Nuno)
- Fixed bug #36392 (wrong number of decimal digits with %e specifier in
sprintf). (Matt,Ilia)
- Fixed bug #33734 (Something strange with COM Object). (Rob)
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 3ed72566c3..6b366623e3 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -660,7 +660,8 @@ PHP_FUNCTION(proc_open)
}
#ifdef PHP_WIN32
- descriptors[ndesc].childend = (HANDLE)_get_osfhandle(fd);
+ descriptors[ndesc].childend = dup_fd_as_handle(fd);
+ _close(fd);
#else
descriptors[ndesc].childend = fd;
#endif