summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/meta/meta_turtle.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2019-03-08 08:19:53 +1100
committerLuke Chen <luke.chen@mongodb.com>2019-03-08 08:19:53 +1100
commit5a7ccd5f073341f5f98e0ced39a80416869c181b (patch)
treee4da15db6037ad02ebc7e69e292afe81fdcff53e /src/third_party/wiredtiger/src/meta/meta_turtle.c
parentf386c49be72744d88fbb0950c54d6621a9d242b8 (diff)
downloadmongo-5a7ccd5f073341f5f98e0ced39a80416869c181b.tar.gz
Import wiredtiger: 82c3f83acae289e0ada5ab4e7fe549e47af1078e from branch mongodb-4.2
ref: afdead1093..82c3f83aca for: 4.1.9 WT-4526 Allow durable updates to be evicted to the lookaside file WT-4571 Explore performance improvement in __wt_txn_id_alloc WT-4602 Clang Tidy and Clang Scan fixes WT-4607 Allow prepared transaction to commit behind oldest timestamp WT-4619 Coverity 111398: leaked memory
Diffstat (limited to 'src/third_party/wiredtiger/src/meta/meta_turtle.c')
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_turtle.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/src/meta/meta_turtle.c b/src/third_party/wiredtiger/src/meta/meta_turtle.c
index 3531440e76f..0c89dca92ed 100644
--- a/src/third_party/wiredtiger/src/meta/meta_turtle.c
+++ b/src/third_party/wiredtiger/src/meta/meta_turtle.c
@@ -193,7 +193,6 @@ __wt_turtle_init(WT_SESSION_IMPL *session)
bool exist_backup, exist_incr, exist_isrc, exist_turtle;
bool load, loadTurtle;
- metaconf = NULL;
load = loadTurtle = false;
/*
@@ -226,10 +225,12 @@ __wt_turtle_init(WT_SESSION_IMPL *session)
* Failure to read means a bad turtle file. Remove it and create
* a new turtle file.
*/
- if (F_ISSET(S2C(session), WT_CONN_SALVAGE))
+ if (F_ISSET(S2C(session), WT_CONN_SALVAGE)) {
WT_WITH_TURTLE_LOCK(session,
- ret = __wt_turtle_read(session,
- WT_METAFILE_URI, &unused_value));
+ ret = __wt_turtle_read(
+ session, WT_METAFILE_URI, &unused_value));
+ __wt_free(session, unused_value);
+ }
if (ret != 0) {
WT_RET(__wt_remove_if_exists(
@@ -282,14 +283,12 @@ __wt_turtle_init(WT_SESSION_IMPL *session)
WT_RET(__metadata_config(session, &metaconf));
WT_WITH_TURTLE_LOCK(session, ret =
__wt_turtle_update(session, WT_METAFILE_URI, metaconf));
- WT_ERR(ret);
+ __wt_free(session, metaconf);
+ WT_RET(ret);
}
/* Remove the backup files, we'll never read them again. */
- WT_ERR(__wt_backup_file_remove(session));
-
-err: __wt_free(session, metaconf);
- return (ret);
+ return (__wt_backup_file_remove(session));
}
/*