diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-11-06 15:13:22 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2018-11-10 15:07:53 +0100 |
commit | 4ded9bb54ceefeb68e766fe9aafc10de934c4501 (patch) | |
tree | 1dfac08e3ce18c48ea46626f3383f9212d9de0d7 /slirp/tcp_subr.c | |
parent | 84ec9bfaf239b61bac3e43f708772937401e0e63 (diff) | |
download | qemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.zip qemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.tar.gz qemu-4ded9bb54ceefeb68e766fe9aafc10de934c4501.tar.bz2 |
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_subr.c')
-rw-r--r-- | slirp/tcp_subr.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 0270c89..fa61349 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -469,11 +469,6 @@ void tcp_connect(struct socket *inso) so = inso; } else { so = socreate(slirp); - if (so == NULL) { - /* If it failed, get rid of the pending connection */ - closesocket(accept(inso->s, (struct sockaddr *)&addr, &addrlen)); - return; - } if (tcp_attach(so) < 0) { g_free(so); /* NOT sofree */ return; |