brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
spans likes a tree,the memory will be destoryed from root, see span.cpp
void Span::destroy() {
EndAsParent();
traversal(this, [](Span* r) {
r->_info.clear();
butil::return_object(r);
});
}
Hi all, This is Qianxin CodeSafe Team, we found a suspicious issue, at https://github.com/apache/brpc/blob/5cdf22f158722b3b11c7eabb7632690d719ccc4b/src/bthread/task_group.cpp#L230 which is allocating memory at https://github.com/apache/brpc/blob/5cdf22f158722b3b11c7eabb7632690d719ccc4b/src/bthread/task_group.cpp#L81 however,the author did not use any functions to free up memory at https://github.com/apache/brpc/blob/5cdf22f158722b3b11c7eabb7632690d719ccc4b/src/bthread/task_group.cpp#L91 so,there is a memory leak in the pointers 'stk' and 's'.