From: Gurusamy Sarathy <gsar@cpan.org>
Date: Fri, 11 Jan 2002 02:56:05 +0000 (+0000)
Subject: malloc() things must be free()d, not Safefree()d (bug in change#11280
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=64aa0685a40fd2a9d443256e8bbb212e76a0828e;p=p5sagit%2Fp5-mst-13.2.git

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

p4raw-link: @11280 on //depot/perl: dc507217b3331807446df6e7f16977ee2fdc418e

p4raw-id: //depot/perl@14177
---

diff --git a/sv.c b/sv.c
index 193c9fb..bc2782d 100644
--- a/sv.c
+++ b/sv.c
@@ -9670,7 +9670,8 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
      * 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 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     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 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     }
 
     SvREFCNT_dec(param->stashes);
-    Safefree(param);
 
     return my_perl;
 }