diff options
author | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-13 12:45:03 +0200 |
---|---|---|
committer | Danny Al-Gaaf <danny.al-gaaf@bisect.de> | 2013-05-14 18:39:30 +0200 |
commit | d8cb7dfc223d7dc37467f8e37a0eb8c8a0228a75 (patch) | |
tree | df457d9dc850054ed0dad63eb9f846ec2f874cfe | |
parent | 349cfb41d0d440338e14a788793230c546295743 (diff) | |
download | ceph-d8cb7dfc223d7dc37467f8e37a0eb8c8a0228a75.tar.gz |
filestore/test_idempotent_sequence.cc: fix FileStore leaks
CID 717107 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Variable "store" going out of scope leaks the
storage it points to.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r-- | src/test/filestore/test_idempotent_sequence.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/test/filestore/test_idempotent_sequence.cc b/src/test/filestore/test_idempotent_sequence.cc index 818a2554c35..d8f8c33ab51 100644 --- a/src/test/filestore/test_idempotent_sequence.cc +++ b/src/test/filestore/test_idempotent_sequence.cc @@ -91,6 +91,8 @@ int run_diff(std::string& a_path, std::string& a_journal, dout(0) << "no diff" << dendl; } + delete a; + delete b; return ret; } @@ -99,8 +101,10 @@ int run_get_last_op(std::string& filestore_path, std::string& journal_path) FileStore *store = new FileStore(filestore_path, journal_path); int err = store->mount(); - if (err) + if (err) { + delete store; return err; + } coll_t txn_coll("meta"); hobject_t txn_object(sobject_t("txn", CEPH_NOSNAP)); @@ -135,6 +139,7 @@ int run_sequence_to(int val, std::string& filestore_path, err = ::mkdir(filestore_path.c_str(), 0755); if (err) { cerr << filestore_path << " already exists" << std::endl; + delete store; return err; } @@ -149,6 +154,7 @@ int run_sequence_to(int val, std::string& filestore_path, op_sequence.generate(seed, num_txs); store->umount(); + delete store; return 0; } |