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:
8ef2b25
)
virtio-9p-proxy: Fix sockfd leak
author
Michael Tokarev
<mjt@tls.msk.ru>
Thu, 30 Oct 2014 07:53:02 +0000
(10:53 +0300)
committer
Michael Tokarev
<mjt@tls.msk.ru>
Sun, 2 Nov 2014 07:04:34 +0000
(10:04 +0300)
If connect() in connect_namedsocket() return false, the sockfd will leak.
Plug it.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
hw/9pfs/virtio-9p-proxy.c
patch
|
blob
|
history
diff --git
a/hw/9pfs/virtio-9p-proxy.c
b/hw/9pfs/virtio-9p-proxy.c
index
b57966d
..
e6bbb06
100644
(file)
--- a/
hw/9pfs/virtio-9p-proxy.c
+++ b/
hw/9pfs/virtio-9p-proxy.c
@@
-1112,6
+1112,7
@@
static int connect_namedsocket(const char *path)
size = strlen(helper.sun_path) + sizeof(helper.sun_family);
if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) {
fprintf(stderr, "socket error\n");
+ close(sockfd);
return -1;
}