diff options
author | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-11-28 13:23:40 +0000 |
---|---|---|
committer | ph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069> | 2014-11-28 13:23:40 +0000 |
commit | 1bed6c30caabd4b4f0a1f392362b26987c41fc82 (patch) | |
tree | 57472cd2f4882bc8fb90e6bf00c0d812d069a6d5 /src/pcre2_match_data.c | |
parent | da0f09e36d4759438bf7d00cf1e1aee0ce740aee (diff) | |
download | pcre2-1bed6c30caabd4b4f0a1f392362b26987c41fc82.tar.gz |
Use allocator from code for pcre2_match_data_create_from_pattern if NULL
passed.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@166 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'src/pcre2_match_data.c')
-rw-r--r-- | src/pcre2_match_data.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pcre2_match_data.c b/src/pcre2_match_data.c index 2182326..1f2fb15 100644 --- a/src/pcre2_match_data.c +++ b/src/pcre2_match_data.c @@ -72,10 +72,13 @@ return yield; * Create a match data block using pattern data * *************************************************/ +/* If no context is supplied, use the memory allocator from the code. */ + PCRE2_EXP_DEFN pcre2_match_data * PCRE2_CALL_CONVENTION pcre2_match_data_create_from_pattern(const pcre2_code *code, pcre2_general_context *gcontext) { +if (gcontext == NULL) gcontext = (pcre2_general_context *)code; return pcre2_match_data_create(((pcre2_real_code *)code)->top_bracket + 1, gcontext); } |