From e8b9ac8fdfddec6a2eaacd6cdaa968058cf4e1e2 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Wed, 24 Apr 2013 19:49:59 -0500 Subject: [PATCH] close fd on error path Signed-off-by: Serge Hallyn --- src/lxc/monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index e108eb764..0521e9ab3 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -69,6 +69,7 @@ static void lxc_monitor_fifo_send(struct lxc_msg *msg, const char *lxcpath) ret = write(fd, msg, sizeof(*msg)); if (ret != sizeof(*msg)) { + close(fd); SYSERROR("failed to write monitor fifo %s", fifo_path); return; }