diff options
author | David Robillard <d@drobilla.net> | 2018-09-16 21:05:35 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-16 21:12:33 +0200 |
commit | c36cd340ac0037ff75c9c287cf4c82e2f58beb2f (patch) | |
tree | fc17307f5f1f96e5c1cb0ffc88a07e8bf5a09dc7 | |
parent | c8d521838d84e832c88387f61ccde0b50e1a967f (diff) | |
download | raul-c36cd340ac0037ff75c9c287cf4c82e2f58beb2f.tar.gz raul-c36cd340ac0037ff75c9c287cf4c82e2f58beb2f.tar.bz2 raul-c36cd340ac0037ff75c9c287cf4c82e2f58beb2f.zip |
Fix potential memory leak
-rw-r--r-- | raul/Socket.hpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/raul/Socket.hpp b/raul/Socket.hpp index c42485f..fed58dd 100644 --- a/raul/Socket.hpp +++ b/raul/Socket.hpp @@ -225,8 +225,9 @@ Socket::accept() struct sockaddr* client_addr = (struct sockaddr*)calloc( 1, client_addr_len); - int conn = ::accept(_sock, client_addr, &client_addr_len); + const int conn = ::accept(_sock, client_addr, &client_addr_len); if (conn == -1) { + free(client_addr); return std::shared_ptr<Socket>(); } |