summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2016-01-06 14:27:46 +1100
committerTony Cook <tony@develop-help.com>2016-01-06 14:27:46 +1100
commit12ffbb10fe94c82dda90efa15d691ababa5b8b8f (patch)
treeecd0dbe2ee5f5adfa7512045b909767b38b405ea /util.c
parent015aa1a8bb85e915bcad7260c8d42e63732ebce5 (diff)
downloadperl-12ffbb10fe94c82dda90efa15d691ababa5b8b8f.tar.gz
[perl #126240] avoid leaking memory when setting $ENV{foo} on darwin
My change in e396210 was incomplete, that change was intended to force use of setenv()/unsetenv() on Darwin, but ended up using putenv() instead, which is a leaky mechanism. Added darwin to the list of many others that work better with setenv()/ unsetenv().
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index 17b62dda76..7c42a1aa8c 100644
--- a/util.c
+++ b/util.c
@@ -2178,7 +2178,7 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
Configure doesn't test for that yet. For Solaris, setenv() and unsetenv()
were introduced in Solaris 9, so testing for HAS UNSETENV is sufficient.
*/
-# if defined(__CYGWIN__)|| defined(__SYMBIAN32__) || defined(__riscos__) || (defined(__sun) && defined(HAS_UNSETENV))
+# if defined(__CYGWIN__)|| defined(__SYMBIAN32__) || defined(__riscos__) || (defined(__sun) && defined(HAS_UNSETENV)) || defined(PERL_DARWIN)
# if defined(HAS_UNSETENV)
if (val == NULL) {
(void)unsetenv(nam);