Change 14177 by gsar@rake on 2002/01/11 02:56:05

        malloc() things must be free()d, not Safefree()d (bug in change#11280
        revealed by -D_USE_MSVCRT_MEM_ALLOC -D_USE_LINKED_LIST)
        
        turns out even the malloc() was never really needed to begin with,
        so get rid of it

Affected files ...

.... //depot/perl/sv.c#505 edit

Differences ...

==== //depot/perl/sv.c#505 (text) ====
Index: perl/sv.c
--- perl/sv.c.~1~       Thu Jan 10 20:00:05 2002
+++ perl/sv.c   Thu Jan 10 20:00:05 2002
@@ -9670,7 +9670,8 @@
      * their pointers copied. */
 
     IV i;
-    CLONE_PARAMS* param = (CLONE_PARAMS*) malloc(sizeof(CLONE_PARAMS));
+    CLONE_PARAMS clone_params;
+    CLONE_PARAMS* param = &clone_params;
 
     PerlInterpreter *my_perl = (PerlInterpreter*)(*ipM->pMalloc)(ipM, 
sizeof(PerlInterpreter));
     PERL_SET_THX(my_perl);
@@ -9699,7 +9700,8 @@
     PL_Proc            = ipP;
 #else          /* !PERL_IMPLICIT_SYS */
     IV i;
-    CLONE_PARAMS* param = (CLONE_PARAMS*) malloc(sizeof(CLONE_PARAMS));
+    CLONE_PARAMS clone_params;
+    CLONE_PARAMS* param = &clone_params;
     PerlInterpreter *my_perl = 
(PerlInterpreter*)PerlMem_malloc(sizeof(PerlInterpreter));
     PERL_SET_THX(my_perl);
 
@@ -10381,7 +10383,6 @@
     }
 
     SvREFCNT_dec(param->stashes);
-    Safefree(param);
 
     return my_perl;
 }
End of Patch.

Reply via email to