summaryrefslogtreecommitdiffstats
path: root/src/launch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/launch.c')
-rw-r--r--src/launch.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/launch.c b/src/launch.c
index cd785014..493455fb 100644
--- a/src/launch.c
+++ b/src/launch.c
@@ -1048,7 +1048,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) {