mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 13:37:02 +03:00
Squash memory leak
svn path=/trunk/netsurf/; revision=3235
This commit is contained in:
parent
6eba75b1c6
commit
f059818d74
@ -2054,11 +2054,14 @@ struct search_node *urldb_search_remove(struct search_node *root,
|
||||
const struct host_part *data)
|
||||
{
|
||||
static struct search_node *last, *deleted;
|
||||
int c;
|
||||
|
||||
assert(root && data);
|
||||
|
||||
if (root != &empty) {
|
||||
int c = urldb_search_match_host(root->data, data);
|
||||
if (root == &empty)
|
||||
return root;
|
||||
|
||||
c = urldb_search_match_host(root->data, data);
|
||||
|
||||
last = root;
|
||||
if (c > 0) {
|
||||
@ -2067,7 +2070,6 @@ struct search_node *urldb_search_remove(struct search_node *root,
|
||||
deleted = root;
|
||||
root->right = urldb_search_remove(root->right, data);
|
||||
}
|
||||
}
|
||||
|
||||
if (root == last) {
|
||||
if (deleted != &empty &&
|
||||
@ -2076,6 +2078,7 @@ struct search_node *urldb_search_remove(struct search_node *root,
|
||||
deleted->data = last->data;
|
||||
deleted = ∅
|
||||
root = root->right;
|
||||
free(last);
|
||||
}
|
||||
} else {
|
||||
if (root->left->level < root->level - 1 ||
|
||||
|
Loading…
Reference in New Issue
Block a user