From 2ffc14ea225096e2970a86c13bec6c7fc2df822b Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Wed, 30 Oct 2013 20:51:54 +1300 Subject: [PATCH] libxl: only close fds which successfully opened in libxl__spawn_local_dm Coverity-ID: 1055565 Signed-off-by: Matthew Daley Reviewed-by: Andrew Cooper Acked-by: Ian Campbell --- tools/libxl/libxl_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index ef29d0b025..24eebda03f 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1259,8 +1259,8 @@ retry_transaction: rc = 0; out_close: - close(null); - close(logfile_w); + if (null != -1) close(null); + if (logfile_w != -1) close(logfile_w); out: if (rc) device_model_spawn_outcome(egc, dmss, rc); -- 2.30.2