This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Tue, 28 Oct 2003 18:36:05 +0000 (18:36 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 28 Oct 2003 18:36:05 +0000 (18:36 +0000)
[ 21564]
Fix more shared threads leaks: add SAVETMPS to the second branch
of sharedsv_scalar_store().
p4raw-link: @21564 on //depot/perl: 6cd54f9c495b4940cfbcbc0445fc8191a10b25bd

p4raw-id: //depot/maint-5.8/perl@21569
p4raw-integrated: from //depot/perl@21568 'copy in'
ext/threads/shared/shared.xs (@21530..)

ext/threads/shared/shared.xs

index 4bf4c78..853b2b7 100644 (file)
@@ -463,12 +463,16 @@ sharedsv_scalar_store(pTHX_ SV *sv, shared_sv *shared)
     else {
         SvTEMP_off(sv);
        SHARED_CONTEXT;
+       ENTER;
+       SAVETMPS;
        sv_setsv_nomg(SHAREDSvPTR(shared), sv);
        if(SvOBJECT(sv)) {
          SV* fake_stash = newSVpv(HvNAME(SvSTASH(sv)),0);
          SvOBJECT_on(SHAREDSvPTR(shared));
          SvSTASH(SHAREDSvPTR(shared)) = (HV*)fake_stash;
        }
+       FREETMPS;
+       LEAVE;
        CALLER_CONTEXT;
     }
     if (!allowed) {