summaryrefslogtreecommitdiff
path: root/src/common/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/db.c')
-rw-r--r--src/common/db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/db.c b/src/common/db.c
index 4dcf1d0b0..595ed241d 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -697,7 +697,7 @@ static void db_free_add(DBMap_impl* db, DBNode node, DBNode *root)
db->alloc_file, db->alloc_line);
exit(EXIT_FAILURE);
}
- if (!(db->options&DB_OPT_DUP_KEY)) { // Make shure we have a key until the node is freed
+ if (!(db->options&DB_OPT_DUP_KEY)) { // Make sure we have a key until the node is freed
old_key = node->key;
node->key = db_dup_key(db, node->key);
db->release(old_key, node->data, DB_RELEASE_KEY);
@@ -1976,13 +1976,13 @@ static int db_obj_vclear(DBMap* self, DBApply func, va_list args)
node->deleted = 1;
}
DB_COUNTSTAT(db_node_free);
- ers_free(db->nodes, node);
if (parent) {
if (parent->left == node)
parent->left = NULL;
else
parent->right = NULL;
}
+ ers_free(db->nodes, node);
node = parent;
}
db->ht[i] = NULL;