diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-05-29 22:07:04 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-05-29 22:07:04 +0100 |
commit | af534a0431cd837092de9abe4bff29feeeafebb3 (patch) | |
tree | c61fea05077e6fbc9dd4c6c05ad08ef94908d6a7 /regcomp.c | |
parent | 1c8f8eb1d500716bc7368dab00869ae3be841e0c (diff) | |
download | perl-af534a0431cd837092de9abe4bff29feeeafebb3.tar.gz |
Properly free paren_name_list with its regexp.
Previously the AV paren_name_list would "leak" until global destruction.
This was only an issue under -DDEBUGGING. Fixes RT #73438.
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4945,7 +4945,7 @@ reStudy: #endif #ifdef DEBUGGING if (RExC_paren_names) { - ri->name_list_idx = add_data( pRExC_state, 1, "p" ); + ri->name_list_idx = add_data( pRExC_state, 1, "a" ); ri->data->data[ri->name_list_idx] = (void*)SvREFCNT_inc(RExC_paren_name_list); } else #endif @@ -9556,6 +9556,7 @@ Perl_regfree_internal(pTHX_ REGEXP * const rx) while (--n >= 0) { /* If you add a ->what type here, update the comment in regcomp.h */ switch (ri->data->what[n]) { + case 'a': case 's': case 'S': case 'u': @@ -9789,8 +9790,9 @@ Perl_regdupe_internal(pTHX_ REGEXP * const rx, CLONE_PARAMS *param) for (i = 0; i < count; i++) { d->what[i] = ri->data->what[i]; switch (d->what[i]) { - /* legal options are one of: sSfpontTu + /* legal options are one of: sSfpontTua see also regcomp.h and pregfree() */ + case 'a': /* actually an AV, but the dup function is identical. */ case 's': case 'S': case 'p': /* actually an AV, but the dup function is identical. */ |