diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-11-04 14:57:49 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-11-04 22:45:35 -0800 |
commit | 600beb2e6249f5c5f73430f8c8da2a6c90891616 (patch) | |
tree | fd4b9e0fd9e7648a225126556640b4a1a7280898 /gv.c | |
parent | b8b90adcbe18ec6f4786e99c9aeb9516913f6d04 (diff) | |
download | perl-600beb2e6249f5c5f73430f8c8da2a6c90891616.tar.gz |
Stop %! after syntax error from leaking the module name
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |