]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
[RGW, memory leak] Memory leak in RGW has been fixed: deletion of allocated pointer... 2003/head
authorAndrey Kuznetsov <Andrey_Kuznetsov@epam.com>
Fri, 27 Jun 2014 06:33:58 +0000 (10:33 +0400)
committerferus.tigris@gmail.com <ferus.tigris@gmail.com>
Sun, 29 Jun 2014 18:26:25 +0000 (22:26 +0400)
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<char const*, std::allocator<char const*> >*, st
==16986==    by 0x5B6B0A: main (in /usr/bin/radosgw)
...

Signed-off-by: Andrey Kuznetsov <Andrey_Kuznetsov@epam.com>
src/log/Log.cc

index 37bb4ef6d72f4b1055756068908e1a26f064fae0..39fd8c4074401563a3b7284f08031527a5e5815f 100644 (file)
@@ -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)