With environ one must use safesysmalloc()/safesysfree().
Jarkko Hietaniemi [Thu, 22 Feb 2001 23:25:45 +0000 (23:25 +0000)]
p4raw-id: //depot/perl@8897

perl.c

diff --git a/perl.c b/perl.c
index f199e46..83c1157 100644 (file)
--- 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;
     }