From: Matthew Daley Date: Wed, 30 Oct 2013 07:51:54 +0000 (+1300) Subject: libxl: only close fds which successfully opened in libxl__spawn_local_dm X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6099 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2ffc14ea225096e2970a86c13bec6c7fc2df822b;p=xen.git 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 --- 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);