From 4ded9bb54ceefeb68e766fe9aafc10de934c4501 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Tue, 6 Nov 2018 15:13:22 +0000 Subject: slirp: Remove code that handles socreate() failure Now that socreate() can never fail, we can remove the code that was trying to handle that situation. In particular this removes code in tcp_connect() that provoked Coverity to complain (CID 1005724): in closesocket(accept(inso->s, (struct sockaddr *)&addr, &addrlen)); if the accept() call fails then we pass closesocket() -1 instead of a valid file descriptor. Signed-off-by: Peter Maydell Signed-off-by: Samuel Thibault --- slirp/tcp_input.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'slirp/tcp_input.c') diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c index 4f79c95fdb..d073ef9525 100644 --- a/slirp/tcp_input.c +++ b/slirp/tcp_input.c @@ -429,8 +429,7 @@ findso: if ((tiflags & (TH_SYN|TH_FIN|TH_RST|TH_URG|TH_ACK)) != TH_SYN) goto dropwithreset; - if ((so = socreate(slirp)) == NULL) - goto dropwithreset; + so = socreate(slirp); if (tcp_attach(so) < 0) { g_free(so); /* Not sofree (if it failed, it's not insqued) */ goto dropwithreset; -- cgit v1.2.3