fix bug: avoid dereferencing content of an already free(3)'ed chunk
This commit is contained in:
parent
586386f70c
commit
f615552554
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166501
@ -126,10 +126,12 @@ add_node(NODE *node, NODE *cur_node)
|
|||||||
static void
|
static void
|
||||||
free_tree(NODE *node)
|
free_tree(NODE *node)
|
||||||
{
|
{
|
||||||
|
NODE *node_next;
|
||||||
while (node) {
|
while (node) {
|
||||||
if (node->right)
|
if (node->right)
|
||||||
free_tree(node->right);
|
free_tree(node->right);
|
||||||
|
node_next = node->left;
|
||||||
free(node);
|
free(node);
|
||||||
node = node->left;
|
node = node_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user