From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH 18/29] libxl: only close fds which successfully opened in libxl__spawn_local_dm Date: Wed, 30 Oct 2013 20:51:54 +1300 Message-ID: <1383119525-26033-19-git-send-email-mattjd@gmail.com> References: <1383119525-26033-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1383119525-26033-1-git-send-email-mattjd@gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Matthew Daley , Ian Jackson , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Coverity-ID: 1055565 Signed-off-by: Matthew Daley --- 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 ef29d0b..24eebda 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); -- 1.7.10.4