summaryrefslogtreecommitdiff
path: root/rerere.h
diff options
context:
space:
mode:
authorLibravatar Karsten Blees <blees@dcon.de>2014-07-17 17:37:57 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 09:32:49 -0700
commite96942e821dec273b884fec378cc2a97a7f5d689 (patch)
tree86c3f3a1efa3bdf6989b819ad5409dc3402be71f /rerere.h
parentWin32: Unicode environment (incoming) (diff)
downloadtgif-e96942e821dec273b884fec378cc2a97a7f5d689.tar.xz
Win32: fix environment memory leaks
All functions that modify the environment have memory leaks. Disable gitunsetenv in the Makefile and use env_setenv (via mingw_putenv) instead (this frees removed environment entries). Move xstrdup from env_setenv to make_augmented_environ, so that mingw_putenv no longer copies the environment entries (according to POSIX [1], "the string [...] shall become part of the environment"). This also fixes the memory leak in gitsetenv, which expects a POSIX compliant putenv. [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/putenv.html Note: This patch depends on taking control of char **environ and having our own mingw_putenv (both introduced in "Win32: Unicode environment (incoming)"). Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Stepan Kasal <kasal@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'rerere.h')
0 files changed, 0 insertions, 0 deletions