From d63abd8dc5e63c0d174d1ddfe34dd1957e5a692b Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Fri, 7 Dec 2007 22:45:20 +0100 Subject: [PATCH] Fixup the clean-up of environment handling. Signed-off-by: Johannes Sixt --- compat/mingw.c | 2 +- git-compat-util.h | 2 +- run-command.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compat/mingw.c b/compat/mingw.c index 553e8f3ac4..8bbe21bb67 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -728,7 +728,7 @@ char **copy_environ() return env; } -void free_env(char **env) +void free_environ(char **env) { int i; for (i = 0; env[i]; i++) diff --git a/git-compat-util.h b/git-compat-util.h index 120f88c943..ab7b668124 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -637,7 +637,7 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler); */ char **copy_environ(void); -void free_environ(void); +void free_environ(char **env); char **env_setenv(char **env, const char *name); #endif /* __MINGW32__ */ diff --git a/run-command.c b/run-command.c index 37d4d7fafc..5ed338c0cb 100644 --- a/run-command.c +++ b/run-command.c @@ -159,7 +159,7 @@ int start_command(struct child_process *cmd) cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env); if (cmd->env) - free(env); + free_environ(env); if (cmd->git_cmd) strbuf_release(&git_cmd);