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.51k stars 3.97k forks source link

Memory leak? #2793

Open QiAnXinCodeSafe opened 1 week ago

QiAnXinCodeSafe commented 1 week 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 2 days ago

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