projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2d3476
)
qemu-sockets: Plug fd leak on unix_connect_opts() error path
author
Markus Armbruster
<armbru@redhat.com>
Fri, 11 Nov 2011 09:40:07 +0000
(10:40 +0100)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Fri, 11 Nov 2011 18:49:52 +0000
(12:49 -0600)
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-sockets.c
patch
|
blob
|
history
diff --git
a/qemu-sockets.c
b/qemu-sockets.c
index 183a9cbbd2837e8407faa7651aa8b72e4c9e3d93..61b2247077834a5ca8084d6e587cb9c710149a87 100644
(file)
--- a/
qemu-sockets.c
+++ b/
qemu-sockets.c
@@
-572,6
+572,7
@@
int unix_connect_opts(QemuOpts *opts)
snprintf(un.sun_path, sizeof(un.sun_path), "%s", path);
if (connect(sock, (struct sockaddr*) &un, sizeof(un)) < 0) {
fprintf(stderr, "connect(unix:%s): %s\n", path, strerror(errno));
+ close(sock);
return -1;
}