projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb16172
)
net/socket.c: Fix fd leak in net_socket_listen_init() error paths
author
Peter Maydell
<peter.maydell@linaro.org>
Sat, 24 Dec 2011 23:47:11 +0000
(23:47 +0000)
committer
Stefan Hajnoczi
<stefanha@linux.vnet.ibm.com>
Fri, 6 Jan 2012 15:07:14 +0000
(15:07 +0000)
Fix a leak of a file descriptor due to missing closesocket() calls
in error paths in net_socket_listen_init().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
net/socket.c
patch
|
blob
|
history
diff --git
a/net/socket.c
b/net/socket.c
index aaf9be48e28bc7c5ae7180fc07823dd4d2409784..c9d70d388e9d23454f6f61d555916a03d0f0dac5 100644
(file)
--- a/
net/socket.c
+++ b/
net/socket.c
@@
-427,12
+427,14
@@
static int net_socket_listen_init(VLANState *vlan,
if (ret < 0) {
perror("bind");
g_free(s);
+ closesocket(fd);
return -1;
}
ret = listen(fd, 0);
if (ret < 0) {
perror("listen");
g_free(s);
+ closesocket(fd);
return -1;
}
s->vlan = vlan;