summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-07-30 12:49:51 -0400
committerKeith Bostic <keith@wiredtiger.com>2015-07-30 12:49:51 -0400
commitce1fe0aef87b3efa23c44e5f2300b9e61a560650 (patch)
treed2f31faf981dc4e69712e64d580872589691d3ac
parent442834053c7ca3e62b769c537e11f8be716e337b (diff)
downloadmongo-ce1fe0aef87b3efa23c44e5f2300b9e61a560650.tar.gz
Minor cleanups to ensure we free memory allocated for keys.
-rw-r--r--test/format/bulk.c1
-rw-r--r--test/format/lrt.c2
-rw-r--r--test/format/ops.c6
3 files changed, 6 insertions, 3 deletions
diff --git a/test/format/bulk.c b/test/format/bulk.c
index 7cf4ba559dc..203043166a4 100644
--- a/test/format/bulk.c
+++ b/test/format/bulk.c
@@ -39,6 +39,7 @@ wts_load(void)
int is_bulk, ret;
conn = g.wts_conn;
+ keybuf = valbuf = NULL;
if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0)
die(ret, "connection.open_session");
diff --git a/test/format/lrt.c b/test/format/lrt.c
index 1e7ebe02ddc..85b6e29f224 100644
--- a/test/format/lrt.c
+++ b/test/format/lrt.c
@@ -47,6 +47,7 @@ lrt(void *arg)
void *buf;
(void)(arg); /* Unused parameter */
+
saved_keyno = 0; /* [-Werror=maybe-uninitialized] */
key_gen_setup(&keybuf);
@@ -168,6 +169,7 @@ lrt(void *arg)
if ((ret = session->close(session, NULL)) != 0)
die(ret, "session.close");
+ free(keybuf);
free(buf);
return (NULL);
diff --git a/test/format/ops.c b/test/format/ops.c
index 3c76a8fcc12..7ed806322cd 100644
--- a/test/format/ops.c
+++ b/test/format/ops.c
@@ -238,13 +238,13 @@ ops(void *arg)
tinfo = arg;
- /* Initialize the per-thread random number generator. */
- __wt_random_init(&tinfo->rnd);
-
conn = g.wts_conn;
keybuf = valbuf = NULL;
readonly = 0; /* -Wconditional-uninitialized */
+ /* Initialize the per-thread random number generator. */
+ __wt_random_init(&tinfo->rnd);
+
/* Set up the default key and value buffers. */
key_gen_setup(&keybuf);
val_gen_setup(&tinfo->rnd, &valbuf);