zouyonghao opened a new issue #1390:
URL: https://github.com/apache/incubator-brpc/issues/1390


   **Describe the bug (描述bug)**
   memory leak when binding failed
   
   **To Reproduce (复现方法)**
   bind a used port
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS: Ubuntu 18.04
   Compiler: clang + ASan
   brpc: 0.9.0
   protobuf: 3.0.0
   
   **Additional context/screenshots (更多上下文/截图)**
   
   ```
   E0428 03:47:30.283096 117030 
/home/zyh/incubator-brpc/src/brpc/server.cpp:956] Fail to listen 0.0.0.0:8301
   E0428 03:47:30.283232 117030 /home/zyh/braft/example/atomic/server.cpp:508] 
Fail to start Server
   
   
   =================================================================
   ==117030==ERROR: LeakSanitizer: detected memory leaks
   
   Direct leak of 56 byte(s) in 1 object(s) allocated from:
       #0 0x6d14ad in operator new(unsigned long) 
(/home/zyh/braft/example/atomic/atomic_server+0x6d14ad)
       #1 0xca1961 in brpc::Server::StartInternal(in_addr const&, 
brpc::PortRange const&, brpc::ServerOptions const*) 
/home/zyh/incubator-brpc/src/brpc/server.cpp:783
       #2 0xca330e in brpc::Server::Start(butil::EndPoint const&, 
brpc::ServerOptions const*) /home/zyh/incubator-brpc/src/brpc/server.cpp:1063
       #3 0xca34b2 in brpc::Server::Start(int, brpc::ServerOptions const*) 
/home/zyh/incubator-brpc/src/brpc/server.cpp:1081
       #4 0x6d5038 in main /home/zyh/braft/example/atomic/server.cpp:507:16
       #5 0x7fa2b2449bf6 in __libc_start_main 
/build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
   
   SUMMARY: AddressSanitizer: 56 byte(s) leaked in 1 allocation(s).
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to