summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/launch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c
index 7f59cabf..9e214bc0 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -953,7 +953,12 @@ launch_appliance (guestfs_h *g)
* able to open a drive.
*/
- close (g->sock); /* Close the listening socket. */
+ /* Close the listening socket. */
+ if (close (g->sock) != 0) {
+ perrorf (g, "close: listening socket");
+ close (r);
+ goto cleanup1;
+ }
g->sock = r; /* This is the accepted data socket. */
if (fcntl (g->sock, F_SETFL, O_NONBLOCK) == -1) {