summaryrefslogtreecommitdiff
path: root/src/meta
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-03-16 13:07:59 -0400
committerKeith Bostic <keith@wiredtiger.com>2016-03-16 13:07:59 -0400
commitc82bed6dc12e6819e73203c034191bf8a1335204 (patch)
tree3d9b00fae3894b2af6dc4e328c4c32ff525e5099 /src/meta
parent4ec307dce22f6162f3ffa7497326f743b483d7d2 (diff)
downloadmongo-c82bed6dc12e6819e73203c034191bf8a1335204.tar.gz
WT-2494: review calls to __wt_free, plus minor bug in an error path.
Remove checks for "pointer != NULL" before calling __wt_free(), they're not needed. In __wt_async_op_init(), don't bother clearing the pointer values after calling __wt_free(), they get cleared by __wt_free(). In __lsm_tree_set_name(), don't leave the tree without a name, by freeing the name and then failing to allocate room for the new one. In __ckpt_last_name(), don't free the wrong pointer in the error path.
Diffstat (limited to 'src/meta')
-rw-r--r--src/meta/meta_ckpt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/meta/meta_ckpt.c b/src/meta/meta_ckpt.c
index df4cd2cb4d6..0a864432daf 100644
--- a/src/meta/meta_ckpt.c
+++ b/src/meta/meta_ckpt.c
@@ -212,8 +212,7 @@ __ckpt_last_name(
if (found && a.val < found)
continue;
- if (*namep != NULL)
- __wt_free(session, *namep);
+ __wt_free(session, *namep);
WT_ERR(__wt_strndup(session, k.str, k.len, namep));
found = a.val;
}
@@ -221,7 +220,7 @@ __ckpt_last_name(
ret = WT_NOTFOUND;
if (0) {
-err: __wt_free(session, namep);
+err: __wt_free(session, *namep);
}
return (ret);
}