rec_priv->node->valuesize = data.dsize;
return NT_STATUS_OK;
}
+ }
+
+ node = (struct db_rbt_node *)talloc_size(db_ctx,
+ offsetof(struct db_rbt_node, data) + rec->key.dsize
+ + data.dsize);
+
+ if (node == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ if (rec_priv->node != NULL) {
/*
* We need to delete the key from the tree and start fresh,
* there's not enough space in the existing record
*/
}
- node = (struct db_rbt_node *)talloc_size(db_ctx,
- offsetof(struct db_rbt_node, data) + rec->key.dsize
- + data.dsize);
-
- if (node == NULL) {
- TALLOC_FREE(rec_priv->node);
- return NT_STATUS_NO_MEMORY;
- }
-
ZERO_STRUCT(node->rb_node);
node->keysize = rec->key.dsize;