summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2012-03-10 12:48:52 -0500
committerKeith Bostic <keith@wiredtiger.com>2012-03-10 12:48:52 -0500
commitaec33706bb1e8ba210322be9ac4dbfd1eb77a390 (patch)
tree53e4c1657f07a06bfb097f42cefbe363c9b3f5c2
parent733c4001d441d062efca266e1278baf05f82691f (diff)
downloadmongo-aec33706bb1e8ba210322be9ac4dbfd1eb77a390.tar.gz
Don't leak the schema-table entry for the file when setting the root.
-rw-r--r--src/btree/bt_root.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/btree/bt_root.c b/src/btree/bt_root.c
index 52e18830b86..873b8ef1171 100644
--- a/src/btree/bt_root.c
+++ b/src/btree/bt_root.c
@@ -314,7 +314,7 @@ __btree_set_root(WT_SESSION_IMPL *session, const char *filename, const char *v)
int ret;
key = newv = NULL;
- newcfg = NULL;
+ cfg[0] = newcfg = NULL;
WT_ERR(__wt_scr_alloc(session, 0, &key));
WT_ERR(__wt_buf_fmt(session, key, "file:%s", filename));
@@ -328,6 +328,7 @@ __btree_set_root(WT_SESSION_IMPL *session, const char *filename, const char *v)
err: __wt_scr_free(&key);
__wt_scr_free(&newv);
+ __wt_free(session, cfg[0]);
__wt_free(session, newcfg);
return (ret);
}