use pcre's own functions to free pcre related structures
This commit is contained in:
parent
6762025fe6
commit
238aee085f
1 changed files with 12 additions and 14 deletions
26
src/node.c
26
src/node.c
|
@ -76,12 +76,12 @@ void r3_tree_free(node * tree) {
|
|||
if (tree->routes) {
|
||||
zfree(tree->routes);
|
||||
}
|
||||
/*
|
||||
if (tree->pcre_pattern)
|
||||
zfree(tree->pcre_pattern);
|
||||
if (tree->pcre_extra)
|
||||
zfree(tree->pcre_extra);
|
||||
*/
|
||||
if (tree->pcre_pattern) {
|
||||
pcre_free(tree->pcre_pattern);
|
||||
}
|
||||
if (n->pcre_extra) {
|
||||
pcre_free_study(n->pcre_extra);
|
||||
}
|
||||
if (tree->combined_pattern)
|
||||
zfree(tree->combined_pattern);
|
||||
if (tree->ov)
|
||||
|
@ -205,14 +205,12 @@ void r3_tree_compile_patterns(node * n) {
|
|||
int erroffset;
|
||||
unsigned int option_bits = 0;
|
||||
|
||||
/*
|
||||
if (n->pcre_pattern)
|
||||
zfree(n->pcre_pattern);
|
||||
if (n->pcre_extra)
|
||||
zfree(n->pcre_extra);
|
||||
*/
|
||||
|
||||
// n->pcre_pattern;
|
||||
if (tree->pcre_pattern) {
|
||||
pcre_free(tree->pcre_pattern);
|
||||
}
|
||||
if (n->pcre_extra) {
|
||||
pcre_free_study(n->pcre_extra);
|
||||
}
|
||||
n->pcre_pattern = pcre_compile(
|
||||
n->combined_pattern, /* the pattern */
|
||||
option_bits, /* default options */
|
||||
|
|
Loading…
Reference in a new issue