summaryrefslogtreecommitdiffstats
path: root/slirp/tcp_input.c
diff options
context:
space:
mode:
authorPeter Maydell2018-11-06 16:13:22 +0100
committerSamuel Thibault2018-11-10 15:07:53 +0100
commit4ded9bb54ceefeb68e766fe9aafc10de934c4501 (patch)
tree1dfac08e3ce18c48ea46626f3383f9212d9de0d7 /slirp/tcp_input.c
parentslirp: Use g_new() to allocate sockets in socreate() (diff)
downloadqemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.tar.gz
qemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.tar.xz
qemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.zip
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 <peter.maydell@linaro.org> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tcp_input.c')
-rw-r--r--slirp/tcp_input.c3
1 files changed, 1 insertions, 2 deletions
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;