summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-07-27 15:39:05 -0400
committerPeter Zhu <[email protected]>2023-07-27 15:39:05 -0400
commitf72f3ab15b79d35e3ddc53d7d3df0e75d5402575 ()
tree55bd23180acbbf0bdf6a35470ef297ed7994fd44
parent7633299c5080b2b37b134ce3c1c82491d127d4d2 (diff)
Use onig_new_without_alloc for onig_new
-rw-r--r--regcomp.c9
1 files changed, 2 insertions, 7 deletions
@@ -6073,20 +6073,15 @@ onig_new(regex_t** reg, const UChar* pattern, const UChar* pattern_end,
OnigOptionType option, OnigEncoding enc, const OnigSyntaxType* syntax,
OnigErrorInfo* einfo)
{
- int r;
-
*reg = (regex_t* )xmalloc(sizeof(regex_t));
if (IS_NULL(*reg)) return ONIGERR_MEMORY;
- r = onig_reg_init(*reg, option, ONIGENC_CASE_FOLD_DEFAULT, enc, syntax);
- if (r) goto err;
-
- r = onig_compile(*reg, pattern, pattern_end, einfo);
if (r) {
- err:
onig_free(*reg);
*reg = NULL;
}
return r;
}