]> 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)
TSRM/tsrm_win32.c

index b43ccdf26b74134e9fc36f2937607ffa99d06140..2e38f1b357df4615038a25cbe6ff1404401c182d 100644 (file)
@@ -373,6 +373,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);