summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/perl.c b/perl.c
index f199e4656f..83c1157f67 100644
--- a/perl.c
+++ b/perl.c
@@ -445,8 +445,9 @@ perl_destruct(pTHXx)
I32 i;
for (i = 0; environ[i]; i++)
- Safefree(environ[i]);
- Safefree(environ);
+ safesysfree(environ[i]);
+ /* Must use safesysfree() when working with environ. */
+ safesysfree(environ);
environ = PL_origenviron;
}