summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2009-08-30 17:13:45 +0000
committerPierre Joye <pajoye@php.net>2009-08-30 17:13:45 +0000
commitceb607af13c370bb30b6bbbd8adde6e053eb7008 (patch)
treea9d6018c7a4f4bcd26575dab28ec3dbcf43a275a
parent30b71027469ed485c4a98531cf04224adc70215d (diff)
downloadphp-git-ceb607af13c370bb30b6bbbd8adde6e053eb7008.tar.gz
- Fixed leak on error in popen/exec (and related functions)
-rw-r--r--NEWS2
-rw-r--r--TSRM/tsrm_win32.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 93db3f8793..cc6f70a974 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PHP NEWS
- Improved shared extension loading on OSX to use the standard Unix dlopen()
API. (Scott)
+- Fixed leak on error in popen/exec (and related functions) on Windows.
+ (Pierre)
- Fixed possible bad caching of symlinked directories in the realpath cache
on Windows. (Pierre)
- Fixed atime and mtime in stat related functions on Windows. (Pierre)
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index b2e94d22af..19139dd7ae 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -371,6 +371,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
+ free(cmd);
return NULL;
}
free(cmd);