summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-04 14:57:49 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-04 22:45:35 -0800
commit600beb2e6249f5c5f73430f8c8da2a6c90891616 (patch)
treefd4b9e0fd9e7648a225126556640b4a1a7280898 /gv.c
parentb8b90adcbe18ec6f4786e99c9aeb9516913f6d04 (diff)
downloadperl-600beb2e6249f5c5f73430f8c8da2a6c90891616.tar.gz
Stop %! after syntax error from leaking the module name
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 612b2ee1fc..40f7c23b39 100644
--- a/gv.c
+++ b/gv.c
@@ -1239,12 +1239,12 @@ S_require_tie_mod(pTHX_ GV *gv, const char *varpv, SV* namesv, const char *methp
const char type = varname == '[' ? '$' : '%';
dSP;
ENTER;
+ SAVEFREESV(namesv);
if ( flags & 1 )
save_scalar(gv);
PUSHSTACKi(PERLSI_MAGIC);
Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, module, NULL);
POPSTACK;
- LEAVE;
stash = gv_stashsv(namesv, 0);
if (!stash)
Perl_croak(aTHX_ "panic: Can't use %c%c because %"SVf" is not available",
@@ -1252,8 +1252,9 @@ S_require_tie_mod(pTHX_ GV *gv, const char *varpv, SV* namesv, const char *methp
else if (!gv_fetchmethod(stash, methpv))
Perl_croak(aTHX_ "panic: Can't use %c%c because %"SVf" does not support method %s",
type, varname, SVfARG(namesv), methpv);
+ LEAVE;
}
- SvREFCNT_dec(namesv);
+ else SvREFCNT_dec(namesv);
return stash;
}