comparison tcp-accept.c @ 621:d2daeb015138

Clean up leaked FD if getnameinfo fails. From Klocwork
author Matt Johnston <matt@ucc.asn.au>
date Thu, 07 Apr 2011 13:52:43 +0000
parents 69e98c45db7c
children abf040aedd44
comparison
equal deleted inserted replaced
620:79d48028457c 621:d2daeb015138
59 } 59 }
60 60
61 if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring), 61 if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring),
62 portstring, sizeof(portstring), 62 portstring, sizeof(portstring),
63 NI_NUMERICHOST | NI_NUMERICSERV) != 0) { 63 NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
64 m_close(fd);
64 return; 65 return;
65 } 66 }
66 67
67 if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) { 68 if (send_msg_channel_open_init(fd, tcpinfo->chantype) == DROPBEAR_SUCCESS) {
68 unsigned char* addr = NULL; 69 unsigned char* addr = NULL;