From 59d18ac22daa64e6c8ccb7bc22da17b450e846f8 Mon Sep 17 00:00:00 2001 From: Andrey Kuznetsov Date: Fri, 27 Jun 2014 10:33:58 +0400 Subject: [PATCH] [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 --- src/log/Log.cc | 1 + 1 file changed, 1 insertion(+) 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) -- 2.39.5