K2InformaticsGmbH/erloci

Memory Leak

Closed this issue · 1 comments

c-bik commented

The valgrind report:

Thread 1:
 40 bytes in 10 blocks are definitely lost in loss record 94 of 327
 at 0x4C28203: operator new(unsigned long) (vg_replace_malloc.c:334)
 by 0x4082A9: map_value_to_bind_args(term&, std::vector<var, std::allocator<var> >&) (marshal.cpp:416)
 by 0x41289B: command::exec_stmt(term&, term&) (command.cpp:526)
 by 0x414DAE: command::process(term&) (command.cpp:878)
 by 0x41A18E: ProcessCommandCb(void*) (threads.cpp:201)
 by 0x415DB1: threadpool_thread(void*) (threadpool.cpp:284)
 by 0x5083DC4: start_thread (in /usr/lib64/libpthread-2.17.so)
 by 0xAF3C73C: clone (in /usr/lib64/libc-2.17.so)

is saying that cleanup attempt

vars[i].valuep.clear();

is not deallocating pointers to different types in the vector

std::vector<void *> valuep;

collected as follows

void * tmp_arg = NULL;
tmp_arg = new float;
tmp_arg = new char[arg_len];
...
vars[i].valuep.push_back(tmp_arg);