diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-03-10 12:47:08 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-03-10 12:47:08 -0500 |
commit | 733c4001d441d062efca266e1278baf05f82691f (patch) | |
tree | 32a847d3ac511bd6926cbd85f425ae92dce00070 | |
parent | 891340b7d53d71f0daf8d2fd85b293f4311c99ff (diff) | |
download | mongo-733c4001d441d062efca266e1278baf05f82691f.tar.gz |
Don't leak the allocated path if the turtle file doesn't yet exist.
-rw-r--r-- | src/btree/bt_root.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/btree/bt_root.c b/src/btree/bt_root.c index 75231a54e21..52e18830b86 100644 --- a/src/btree/bt_root.c +++ b/src/btree/bt_root.c @@ -178,7 +178,8 @@ __btree_get_turtle( path = NULL; WT_RET(__wt_filename(session, WT_SCHEMA_TURTLE, &path)); - WT_RET_TEST((fp = fopen(path, "r")) == NULL, 0); + if ((fp = fopen(path, "r")) == NULL) + goto done; while (fgets(line, (int)sizeof(line), fp) != NULL) { if ((p = strchr(line, '\n')) == NULL) break; |