]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test_filejournal.cc: cleanup memory in destructor
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 13 May 2013 11:52:32 +0000 (13:52 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 14 May 2013 16:39:30 +0000 (18:39 +0200)
CID 716885 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
  alloc_new: Allocating memory by calling "new C_SafeCond(&this->lock,
    &this->cond, &this->done, NULL)".
  ctor_dtor_leak: The constructor allocates field "c" of "C_Sync" but
    the destructor and whatever functions it calls do not free it.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/test/test_filejournal.cc

index 7365e97dec0a923f60b4e46c6b6e6667132c6f2f..05bd4acb89ec88e7a059283b6a1a550367c0bf8f 100644 (file)
@@ -52,6 +52,8 @@ public:
       cond.Wait(lock);
     //cout << "waited" << std::endl;
     lock.Unlock();
+    if (c)
+      delete c;
   }
 };