diff options
author | Jeremy Allison <jra@samba.org> | 2007-12-18 17:30:02 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-12-18 17:30:02 -0800 |
commit | c99dc69a453a67a38b1a1d5c5088a55d22a68651 (patch) | |
tree | 6cfe0277964f2740bd6060aa8afccc173aac86c4 /source3/lib | |
parent | 537c4cf9cdb1f76c317c8fbd12068ce1f3fbbf0b (diff) | |
download | samba-c99dc69a453a67a38b1a1d5c5088a55d22a68651.tar.gz samba-c99dc69a453a67a38b1a1d5c5088a55d22a68651.tar.bz2 samba-c99dc69a453a67a38b1a1d5c5088a55d22a68651.zip |
We've finished with the old node once we've copied the
keyval.
Jeremy.
(This used to be commit 39f3efbcc5fbdff1db1b12e5fc7368968f240993)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap_rbt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/lib/dbwrap_rbt.c b/source3/lib/dbwrap_rbt.c index 15d9b67414..468b9405ee 100644 --- a/source3/lib/dbwrap_rbt.c +++ b/source3/lib/dbwrap_rbt.c @@ -121,6 +121,10 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag) memcpy(this_key.dptr, rec->key.dptr, node->keysize); memcpy(this_val.dptr, data.dptr, node->valuesize); + if (del_old_keyval) { + SAFE_FREE(rec_priv->node); + } + parent = NULL; p = &rec_priv->db_ctx->tree.rb_node; @@ -157,10 +161,6 @@ static NTSTATUS db_rbt_store(struct db_record *rec, TDB_DATA data, int flag) rb_link_node(&node->rb_node, parent, p); rb_insert_color(&node->rb_node, &rec_priv->db_ctx->tree); - if (del_old_keyval) { - SAFE_FREE(rec_priv->node); - } - return NT_STATUS_OK; } |