From: Artur Bergman Date: Sat, 4 Jan 2003 01:27:55 +0000 (+0000) Subject: Fix long standing memory leak with pop and shift! X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b0189785ebb861ff80a74fea35fdf10d45b2c89;p=p5sagit%2Fp5-mst-13.2.git Fix long standing memory leak with pop and shift! p4raw-id: //depot/perl@18421 --- diff --git a/ext/threads/shared/shared.xs b/ext/threads/shared/shared.xs index 2a08fb0..c5a210f 100644 --- a/ext/threads/shared/shared.xs +++ b/ext/threads/shared/shared.xs @@ -813,8 +813,9 @@ CODE: SHARED_CONTEXT; sv = av_pop((AV*)SHAREDSvPTR(shared)); CALLER_CONTEXT; - ST(0) = Nullsv; + ST(0) = sv_newmortal(); Perl_sharedsv_associate(aTHX_ &ST(0), sv, 0); + SvREFCNT_dec(sv); LEAVE_LOCK; XSRETURN(1); @@ -827,8 +828,9 @@ CODE: SHARED_CONTEXT; sv = av_shift((AV*)SHAREDSvPTR(shared)); CALLER_CONTEXT; - ST(0) = Nullsv; + ST(0) = sv_newmortal(); Perl_sharedsv_associate(aTHX_ &ST(0), sv, 0); + SvREFCNT_dec(sv); LEAVE_LOCK; XSRETURN(1);