summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-03-04 11:59:18 -0700
committerKarl Williamson <khw@cpan.org>2016-03-04 12:04:20 -0700
commit88474c07fbd1a35a58cf4b0d6a0665044ecdb7fb (patch)
tree3edd64ba9713647de56ff81f0b063aaa0926a600 /regcomp.c
parentabe1abcfb267758acc51af14494e2e293b2fd873 (diff)
downloadperl-88474c07fbd1a35a58cf4b0d6a0665044ecdb7fb.tar.gz
regcomp.c: Fix a memory leak
This revises 5751998882d1db1c0f62a32a0b16e58176928a35 so that it works if a called function fails to return (it was failing if there was illegal tainting going on).
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/regcomp.c b/regcomp.c
index f7f1b2f0f9..9b63fef168 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -15885,6 +15885,7 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
* discussed in commit
* 2f833f5208e26b208886e51e09e2c072b5eabb46 */
name = savepv(Perl_form(aTHX_ "%.*s", (int)n, RExC_parse));
+ SAVEFREEPV(name);
if (FOLD) {
lookup_name = savepv(Perl_form(aTHX_ "__%s_i", name));
}
@@ -15950,7 +15951,6 @@ 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"\"",
@@ -15968,8 +15968,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
pkgname,
name);
n = strlen(full_name);
- Safefree(name);
name = savepvn(full_name, n);
+ SAVEFREEPV(name);
}
}
Perl_sv_catpvf(aTHX_ listsv, "%cutf8::%s%"UTF8f"%s\n",
@@ -16024,7 +16024,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
_invlist_union(properties, invlist, &properties);
}
}
- Safefree(name);
}
RExC_parse = e + 1;
namedclass = ANYOF_UNIPROP; /* no official name, but it's