From 349cfb41d0d440338e14a788793230c546295743 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Mon, 13 May 2013 11:50:37 +0200 Subject: [PATCH] ceph-filestore-dump.cc: cleanup on error case CID 1019589 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage: Variable "t" going out of scope leaks the storage it points to. Signed-off-by: Danny Al-Gaaf --- src/tools/ceph-filestore-dump.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/ceph-filestore-dump.cc b/src/tools/ceph-filestore-dump.cc index 5587ef4dcff60..1c09de6c0a33f 100644 --- a/src/tools/ceph-filestore-dump.cc +++ b/src/tools/ceph-filestore-dump.cc @@ -357,7 +357,7 @@ void remove_coll(ObjectStore *store, const coll_t &coll) r = store->collection_list_partial(coll, next, 200, 300, 0, &objects, &next); if (r < 0) - return; + goto out; for (vector::iterator i = objects.begin(); i != objects.end(); ++i, ++num) { @@ -380,6 +380,7 @@ void remove_coll(ObjectStore *store, const coll_t &coll) } t->remove_collection(coll); store->apply_transaction(*t); +out: delete t; } -- 2.39.5