This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcomp.c: Avoid a memory leak
authorKarl Williamson <khw@cpan.org>
Thu, 3 Mar 2016 16:56:41 +0000 (09:56 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 3 Mar 2016 23:09:24 +0000 (16:09 -0700)
The croak is using heap storage for an argument.  Making that
SAVEFREEPV() will make sure it gets freed.

regcomp.c

index 54b4236..186ac57 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -15944,6 +15944,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
                                   ? "Illegal user-defined property name"
                                   : "Can't find Unicode property definition";
                             RExC_parse = e + 1;
+                            SAVEFREEPV(name);
 
                             /* diag_listed_as: Can't find Unicode property definition "%s" */
                             vFAIL3utf8f("%s \"%"UTF8f"\"",