From a966ab428ac07726e6e6996e902364679ea81b77 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sun, 30 Aug 2009 17:13:45 +0000 Subject: [PATCH] - Fixed leak on error in popen/exec (and related functions) --- NEWS | 2 ++ TSRM/tsrm_win32.c | 1 + 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index d3788b590b..e47f75cb34 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP NEWS ?? ??? 2009, PHP 5.2.11 - Added missing sanity checks around exif processing (Ilia) +- Fixed leak on error in popen/exec (and related functions on Windows. (Pierre) + - Fixed bug #49289 (bcmath module doesn't compile with phpize configure). (Jani) - Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index f523ead703..01f1af2f31 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -239,6 +239,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")); sprintf(cmd, "%s /c %s", TWG(comspec), command); if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW, env, cwd, &startup, &process)) { + free(cmd); return NULL; } free(cmd); -- 2.50.1