apache / brpc

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".
https://brpc.apache.org
Apache License 2.0
16.56k stars 3.98k forks source link

Memory leak? #2793

Open QiAnXinCodeSafe opened 1 month ago

QiAnXinCodeSafe commented 1 month ago

Hi all, This is Qianxin CodeSafe Team, we found a suspicious issue, at https://github.com/apache/brpc/blob/5cdf22f158722b3b11c7eabb7632690d719ccc4b/tools/parallel_http/parallel_http.cpp#L210 which is allocating memory at https://github.com/apache/brpc/blob/5cdf22f158722b3b11c7eabb7632690d719ccc4b/tools/parallel_http/parallel_http.cpp#L138

If none of the previous loops are truel,this will result in a return of 0 and a memory leak of point “args”

chenBright commented 3 weeks ago

Thanks for the feedback. I will optimize the implementation and solve the memory leak problem later.