diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-18 18:33:46 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2011-10-18 18:33:46 +1100 |
commit | 99e974d88068b28475e3c13bdb2f44e89a42537e (patch) | |
tree | 8d96fb4f6f70afe932c60f7ec3e162c370ebf791 /src/btree/bt_huffman.c | |
parent | 77f27b3e5d73a0998a53481b038562079c758efb (diff) | |
download | mongo-99e974d88068b28475e3c13bdb2f44e89a42537e.tar.gz |
If creating a file fails, the caller should free the config string.
Don't put the config into the btree handle until we're sure the call will succeed.
refs #123
Diffstat (limited to 'src/btree/bt_huffman.c')
-rw-r--r-- | src/btree/bt_huffman.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/btree/bt_huffman.c b/src/btree/bt_huffman.c index 145f8f27a42..1e3f960081c 100644 --- a/src/btree/bt_huffman.c +++ b/src/btree/bt_huffman.c @@ -132,22 +132,19 @@ static int __wt_huffman_read(WT_SESSION_IMPL *, * Configure Huffman encoding for the tree. */ int -__wt_btree_huffman_open(WT_SESSION_IMPL *session) +__wt_btree_huffman_open(WT_SESSION_IMPL *session, const char *config) { WT_BTREE *btree; u_int entries, numbytes; struct __wt_huffman_table *table; WT_CONFIG_ITEM key_conf, value_conf; - const char *config; int ret; btree = session->btree; - config = btree->config; - WT_RET(__wt_config_getones(session, - config, "huffman_key", &key_conf)); - WT_RET(__wt_config_getones(session, - config, "huffman_value", &value_conf)); + WT_RET(__wt_config_getones(session, config, "huffman_key", &key_conf)); + WT_RET(__wt_config_getones( + session, config, "huffman_value", &value_conf)); if (key_conf.len == 0 && value_conf.len == 0) return (0); |