there is already a pointer guard in zmalloc
This commit is contained in:
parent
c841de166c
commit
59e6997959
2 changed files with 6 additions and 14 deletions
|
@ -80,9 +80,7 @@ node * r3_edge_branch(edge *e, int dl) {
|
|||
}
|
||||
|
||||
void r3_edge_free(edge * e) {
|
||||
if (e->pattern) {
|
||||
zfree(e->pattern);
|
||||
}
|
||||
zfree(e->pattern);
|
||||
if ( e->child ) {
|
||||
r3_tree_free(e->child);
|
||||
}
|
||||
|
|
16
src/node.c
16
src/node.c
|
@ -70,12 +70,9 @@ void r3_tree_free(node * tree) {
|
|||
r3_edge_free(tree->edges[ i ]);
|
||||
}
|
||||
}
|
||||
if (tree->edges) {
|
||||
zfree(tree->edges);
|
||||
}
|
||||
if (tree->routes) {
|
||||
zfree(tree->routes);
|
||||
}
|
||||
zfree(tree->edges);
|
||||
zfree(tree->routes);
|
||||
|
||||
if (tree->pcre_pattern) {
|
||||
pcre_free(tree->pcre_pattern);
|
||||
}
|
||||
|
@ -84,11 +81,8 @@ void r3_tree_free(node * tree) {
|
|||
pcre_free_study(tree->pcre_extra);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (tree->combined_pattern)
|
||||
zfree(tree->combined_pattern);
|
||||
if (tree->ov)
|
||||
zfree(tree->ov);
|
||||
zfree(tree->combined_pattern);
|
||||
zfree(tree->ov);
|
||||
zfree(tree);
|
||||
tree = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue