Open xuwh9 opened 5 months ago
there's a memory leak.
Returns: A pointer to the start of the NUL-terminated demangled name, or NULL if the demangling fails. The caller is responsible for deallocating this memory using free.
abi::__cxa_demangle
malloc the memory, and caller need to free it. So there's a memory leak
there's a memory leak.
Returns: A pointer to the start of the NUL-terminated demangled name, or NULL if the demangling fails. The caller is responsible for deallocating this memory using free.
abi::__cxa_demangle
malloc the memory, and caller need to free it. So there's a memory leak
OK. Not only this function, there are other functions call abi::__cxa_demangle and lost the memory. Like in file modules/planning/planning_interface_base/task.cc,Task::Init(), is where the worst impact is, will cause a persistent memory leak.
as shown, a string obj constructed with a ptr returned by __cxa_demangle(), but never free. and the string obj may not able to free this memory, who always destruct its own memory. I'm curious if there is a memory leak here.
many thanks for your reply.