diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-05-20 15:23:17 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-05-20 15:23:17 -0400 |
commit | d1f76fdac4aac057c31bbd29d9a7644022bc1de4 (patch) | |
tree | a8cace75229fb5387b48e00d425097d014d78aff | |
parent | bc2fbd1db8076ab61d0e6698c7e8f960e26680fb (diff) | |
download | mongo-d1f76fdac4aac057c31bbd29d9a7644022bc1de4.tar.gz |
Fix a memory leak, thanks valgrind!
-rw-r--r-- | test/thread/rw.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/thread/rw.c b/test/thread/rw.c index 795673a0890..f0d7929b8e3 100644 --- a/test/thread/rw.c +++ b/test/thread/rw.c @@ -83,15 +83,14 @@ rw_start(u_int readers, u_int writers) die("calloc", errno); /* Create the files and load the initial records. */ - for (i = 0; i < readers + writers; ++i) { - if ((run_info[i].name = malloc(64)) == NULL) - die("malloc", errno); + for (i = 0; i < readers + writers; ++i) if (i == 0 || multiple_files) { + if ((run_info[i].name = malloc(64)) == NULL) + die("malloc", errno); snprintf(run_info[i].name, 64, FNAME, i); load(run_info[i].name); } else run_info[i].name = run_info[0].name; - } (void)gettimeofday(&start, NULL); |