[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH 4/4] launch: unix: Set g->daemon_sock = -1 after closing it.



From: "Richard W.M. Jones" <rjones redhat com>

This ensures we don't accidentally use the closed fd.
---
 src/launch-unix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/launch-unix.c b/src/launch-unix.c
index 69de2f7..db49a3c 100644
--- a/src/launch-unix.c
+++ b/src/launch-unix.c
@@ -98,6 +98,7 @@ launch_unix (guestfs_h *g, const char *sockpath)
 
  cleanup:
   close (g->daemon_sock);
+  g->daemon_sock = -1;
   return -1;
 }
 
-- 
1.8.1.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]