use pcre's own functions to free pcre related structures

This commit is contained in:
c9s 2014-05-21 18:16:48 +08:00
parent 6762025fe6
commit 238aee085f

View file

@ -76,12 +76,12 @@ void r3_tree_free(node * tree) {
if (tree->routes) { if (tree->routes) {
zfree(tree->routes); zfree(tree->routes);
} }
/* if (tree->pcre_pattern) {
if (tree->pcre_pattern) pcre_free(tree->pcre_pattern);
zfree(tree->pcre_pattern); }
if (tree->pcre_extra) if (n->pcre_extra) {
zfree(tree->pcre_extra); pcre_free_study(n->pcre_extra);
*/ }
if (tree->combined_pattern) if (tree->combined_pattern)
zfree(tree->combined_pattern); zfree(tree->combined_pattern);
if (tree->ov) if (tree->ov)
@ -205,14 +205,12 @@ void r3_tree_compile_patterns(node * n) {
int erroffset; int erroffset;
unsigned int option_bits = 0; unsigned int option_bits = 0;
/* if (tree->pcre_pattern) {
if (n->pcre_pattern) pcre_free(tree->pcre_pattern);
zfree(n->pcre_pattern); }
if (n->pcre_extra) if (n->pcre_extra) {
zfree(n->pcre_extra); pcre_free_study(n->pcre_extra);
*/ }
// n->pcre_pattern;
n->pcre_pattern = pcre_compile( n->pcre_pattern = pcre_compile(
n->combined_pattern, /* the pattern */ n->combined_pattern, /* the pattern */
option_bits, /* default options */ option_bits, /* default options */