This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Don’t leak memory
authorFather Chrysostomos <sprout@cpan.org>
Mon, 27 Nov 2017 00:33:09 +0000 (16:33 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 27 Nov 2017 00:33:09 +0000 (16:33 -0800)
toke.c

diff --git a/toke.c b/toke.c
index ececc94..a3d911b 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -9331,6 +9331,7 @@ S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
        char *d2;
         Newx(d, *s - olds + saw_tick + 2, char); /* +2 for $# */
         d2 = d;
+        SAVEFREEPV(d);
         Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
                          "Old package separator used in string");
         if (olds[-1] == '#')