diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-08-31 21:11:54 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-08-31 21:13:53 -0400 |
commit | c92bd267dadcfc1efb68fe76d4b5ebcd854c5b7f (patch) | |
tree | 2c4bbbfff9ac7320bc79eac8042f24021234307d /src/btree/bt_slvg.c | |
parent | 83969ff7cb7315b280bb9feb0541fb46cb84d06f (diff) | |
download | mongo-c92bd267dadcfc1efb68fe76d4b5ebcd854c5b7f.tar.gz |
If we fail to acquire a block during salvage (in this case because
the decompression of the block failed), free the block immediately.
Issue #1191.
Diffstat (limited to 'src/btree/bt_slvg.c')
-rw-r--r-- | src/btree/bt_slvg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c index 0dfc5853fff..5d03bd54988 100644 --- a/src/btree/bt_slvg.c +++ b/src/btree/bt_slvg.c @@ -361,8 +361,10 @@ __slvg_read(WT_SESSION_IMPL *session, WT_STUFF *ss) * configured, else we may be relying on compression. If the * read fails, simply move to the next potential block. */ - if (__wt_bt_read(session, buf, addr, addr_size) != 0) + if (__wt_bt_read(session, buf, addr, addr_size) != 0) { + WT_ERR(bm->free(bm, session, addr, addr_size)); continue; + } /* Tell the block manager we're taking this one. */ WT_ERR(bm->salvage_valid(bm, session, addr, addr_size)); |