From: Andrey Kuznetsov Date: Fri, 27 Jun 2014 06:33:58 +0000 (+0400) Subject: [RGW, memory leak] Memory leak in RGW has been fixed: deletion of allocated pointer... X-Git-Tag: v0.84~167^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=59d18ac22daa64e6c8ccb7bc22da17b450e846f8;p=ceph.git [RGW, memory leak] Memory leak in RGW has been fixed: deletion of allocated pointer to pointer to Log object has been added to "on_exit" handler. Memory leaks detector report: $ valgrind --leak-check=full /usr/bin/radosgw -c /etc/ceph/ceph.conf -n client.radosgw.gateway - ... ==16986== 8 bytes in 1 blocks are definitely lost in loss record 14 of 83 ==16986== at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298) ==16986== by 0x58980B8: ceph::log::Log::set_flush_on_exit() (in /usr/lib64/librados.so.2.0.0) ==16986== by 0x6BE3CA: global_init(std::vector >*, st ==16986== by 0x5B6B0A: main (in /usr/bin/radosgw) ... Signed-off-by: Andrey Kuznetsov --- diff --git a/src/log/Log.cc b/src/log/Log.cc index 37bb4ef6d72f4..39fd8c4074401 100644 --- a/src/log/Log.cc +++ b/src/log/Log.cc @@ -31,6 +31,7 @@ static void log_on_exit(void *p) Log *l = *(Log **)p; if (l) l->flush(); + delete (Log **)p;// Delete allocated pointer (not Log object, the pointer only!) } Log::Log(SubsystemMap *s)