]> granicus.if.org Git - php/commitdiff
- Fixed leak on error in popen/exec (and related functions)
authorPierre Joye <pajoye@php.net>
Sun, 30 Aug 2009 17:13:45 +0000 (17:13 +0000)
committerPierre Joye <pajoye@php.net>
Sun, 30 Aug 2009 17:13:45 +0000 (17:13 +0000)
NEWS
TSRM/tsrm_win32.c

diff --git a/NEWS b/NEWS
index d3788b590b4883a7542d3a7b5ca489722f8dd5fd..e47f75cb348ca16afbbb12a1f74083b384a0e9a1 100644 (file)
--- 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)
index f523ead70348ea90130954a371c756705eea9b4e..01f1af2f31cfd9d2b983d145d955d5949ee74f61 100644 (file)
@@ -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);