along with a bunch other named capture related leaks.
p4raw-id: //depot/perl@34151
} else {
ret = newSVsv(&PL_sv_undef);
}
- if (retarray) {
- SvREFCNT_inc_simple_void(ret);
+ if (retarray)
av_push(retarray, ret);
- }
}
if (retarray)
- return newRV((SV*)retarray);
+ return newRV_noinc((SV*)retarray);
}
}
return NULL;
ret = CALLREG_NAMED_BUFF_ALL(r, (flags | RXapif_REGNAMES));
av = (AV*)SvRV(ret);
length = av_len(av);
+ SvREFCNT_dec(ret);
return newSViv(length + 1);
} else {
Perl_croak(aTHX_ "panic: Unknown flags %d in named_buff_scalar", (int)flags);
}
}
- return newRV((SV*)av);
+ return newRV_noinc((SV*)av);
}
void
SPAGAIN;
if (ret) {
- XPUSHs(ret);
+ mXPUSHs(ret);
PUTBACK;
return;
} else {
ret = CALLREG_NAMED_BUFF_FETCH(rx, ST(0), (flags | RXapif_REGNAME));
if (ret) {
- if (SvROK(ret))
- XPUSHs(ret);
- else
- XPUSHs(SvREFCNT_inc(ret));
+ mXPUSHs(ret);
XSRETURN(1);
}
XSRETURN_UNDEF;
if (!entry)
Perl_croak(aTHX_ "NULL array element in re::regnames()");
- XPUSHs(*entry);
+ mXPUSHs(SvREFCNT_inc_simple_NN(*entry));
}
+
+ SvREFCNT_dec(ret);
+
PUTBACK;
return;
}
SPAGAIN;
if (ret) {
- if (SvROK(ret))
- XPUSHs(ret);
- else
- XPUSHs(SvREFCNT_inc(ret));
+ mXPUSHs(ret);
PUTBACK;
return;
}
SPAGAIN;
if (ret) {
- XPUSHs(SvREFCNT_inc(ret));
+ mXPUSHs(ret);
PUTBACK;
} else {
XSRETURN_UNDEF;
SPAGAIN;
if (ret) {
- XPUSHs(ret);
+ mXPUSHs(ret);
} else {
XSRETURN_UNDEF;
}
SPAGAIN;
if (ret) {
- XPUSHs(ret);
+ mXPUSHs(ret);
PUTBACK;
return;
} else {