From ca6d5fd05ce7e2ae6ea31b061fbd0ec07c9de3d5 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Thu, 7 Apr 2011 13:52:43 +0000 Subject: Clean up leaked FD if getnameinfo fails. From Klocwork --HG-- extra : convert_revision : 712881a0b28aa45804bed6803fb72a4a35714e41 --- tcp-accept.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tcp-accept.c') 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; } -- cgit v1.2.3