create_tcpip_socket() never returns a valid fd and left port as 0.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
int fd;
fd = create_tcpip_socket(ifss, &p);
- if (fd < 0 || p == 0) {
+ if (fd < 0) {
status = NT_STATUS_UNSUCCESSFUL;
- if (fd != -1) {
- close(fd);
- }
goto done;
}
listen_fd[*listen_fd_size] = fd;
}
fd = create_tcpip_socket(&ss, &p);
- if (fd < 0 || p == 0) {
+ if (fd < 0) {
status = NT_STATUS_UNSUCCESSFUL;
- if (fd != -1) {
- close(fd);
- }
goto done;
}
listen_fd[*listen_fd_size] = fd;