This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_system: safe to switch in sv_setpvn_fresh here
[perl5.git] / pp_sys.c
index db20152..25eda27 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4364,7 +4364,7 @@ PP(pp_system)
             sv_2mortal(copysv);
             if (SvPOK(origsv) || SvPOKp(origsv)) {
                 pv = SvPV_nomg(origsv, len);
-                sv_setpvn(copysv, pv, len);
+                sv_setpvn_fresh(copysv, pv, len);
                 SvPOK_off(copysv);
             }
             if (SvIOK(origsv) || SvIOKp(origsv))