diff options
Diffstat (limited to 'universal.c')
-rw-r--r-- | universal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/universal.c b/universal.c index d623a67ed3..0599e6795d 100644 --- a/universal.c +++ b/universal.c @@ -927,8 +927,8 @@ XS(XS_Internals_SvREFCNT) /* This is dangerous stuff. */ XSRETURN_IV(SvREFCNT(sv) - 1); /* Minus the ref created for us. */ else if (items == 2) { /* I hope you really know what you are doing. */ - SvREFCNT(sv) = SvIV(ST(1)); - XSRETURN_IV(SvREFCNT(sv)); + SvREFCNT(sv) = SvIV(ST(1)) + 1; /* we free one ref on exit */ + XSRETURN_IV(SvREFCNT(sv) - 1); } XSRETURN_UNDEF; /* Can't happen. */ } |