From: Rafael Garcia-Suarez <rgarciasuarez@gmail.com>
Date: Thu, 14 Feb 2008 15:05:38 +0000 (+0000)
Subject: Fix leak when issuing new warning implemented by #33305
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c4a2fd1a6f3d0c03ef36d62769626507e9118be2;p=p5sagit%2Fp5-mst-13.2.git

Fix leak when issuing new warning implemented by #33305

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

diff --git a/op.c b/op.c
index 2c03377..ab5041f 100644
--- a/op.c
+++ b/op.c
@@ -1075,7 +1075,7 @@ Perl_scalarvoid(pTHX_ OP *o)
 	    no_bareword_allowed(o);
 	else {
 	    if (ckWARN(WARN_VOID)) {
-		SV* msv = Perl_newSVpvf(aTHX_ "a constant (%"SVf")", sv);
+		SV* msv = sv_2mortal(Perl_newSVpvf(aTHX_ "a constant (%"SVf")", sv));
 		useless = SvPV_nolen(msv);
 		if (o->op_private & OPpCONST_ARYBASE)
 		    useless = NULL;