]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds/MDSDaemon.cc: fix resource leak in MDSDaemon
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 21 Aug 2015 14:11:16 +0000 (16:11 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 10 Sep 2015 17:29:20 +0000 (19:29 +0200)
commite243aa84c0bc3e7c15178fc5a5a7499db3b88c37
tree7946a1be7d9c7f0e6dba6c4205e9cea8d90ffc90
parenta29dd45dd89f59ff15018f541601ac5ede162174
mds/MDSDaemon.cc: fix resource leak in MDSDaemon

Delete mdsmap in descructor. Remove not needed checks for
mds_rank and objecter before call delete since the C++ standard
allows the deletion of pointer with NULL-value. The check is
redundant.

Fix for:
CID 1316224 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK)
1. alloc_new: Allocating memory by calling new MDSMap.
2. var_assign: Assigning: this->mdsmap = new MDSMap.
3. ctor_dtor_leak: The constructor allocates field mdsmap of MDSDaemon
   but the destructor and whatever functions it calls do not free it.

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