summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/util.c b/util.c
index 16fae9a027..e09147fe37 100644
--- a/util.c
+++ b/util.c
@@ -6486,10 +6486,9 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
}
if (sv) {
SV *xpt = NULL;
- SV *xssv = Perl_newSVpvn(aTHX_ xs_p, xs_len);
+ SV *xssv = Perl_newSVpvn_flags(aTHX_ xs_p, xs_len, SVs_TEMP);
SV *pmsv = sv_derived_from(sv, "version")
- ? SvREFCNT_inc_simple_NN(sv)
- : new_version(sv);
+ ? sv : sv_2mortal(new_version(sv));
xssv = upg_version(xssv, 0);
if ( vcmp(pmsv,xssv) ) {
xpt = Perl_newSVpvf(aTHX_ "%s object version %"SVf
@@ -6501,11 +6500,8 @@ Perl_xs_version_bootcheck(pTHX_ U32 items, U32 ax, const char *xs_p,
vn ? vn : "bootstrap parameter",
SVfARG(Perl_sv_2mortal(aTHX_ vstringify(pmsv))));
Perl_sv_2mortal(aTHX_ xpt);
- }
- SvREFCNT_dec(xssv);
- SvREFCNT_dec(pmsv);
- if (xpt)
Perl_croak_sv(aTHX_ xpt);
+ }
}
}