diff options
author | Matt Johnston <matt@ucc.asn.au> | 2011-04-07 13:52:43 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2011-04-07 13:52:43 +0000 |
commit | ca6d5fd05ce7e2ae6ea31b061fbd0ec07c9de3d5 (patch) | |
tree | c1f83a00eafff1694d10481af51131cf9bc2dafb /tcp-accept.c | |
parent | b9e21e236771e819b86f324c0c20048546ccdcb6 (diff) |
Clean up leaked FD if getnameinfo fails. From Klocwork
--HG--
extra : convert_revision : 712881a0b28aa45804bed6803fb72a4a35714e41
Diffstat (limited to 'tcp-accept.c')
-rw-r--r-- | tcp-accept.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tcp-accept.c b/tcp-accept.c index cf0aa7a..92d4afe 100644 --- a/tcp-accept.c +++ b/tcp-accept.c @@ -61,6 +61,7 @@ static void tcp_acceptor(struct Listener *listener, int sock) { if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring), portstring, sizeof(portstring), NI_NUMERICHOST | NI_NUMERICSERV) != 0) { + m_close(fd); return; } |