From: Juergen Gross Date: Tue, 9 Jun 2020 14:48:49 +0000 (+0200) Subject: tools: fix error path of xenhypfs_open() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~90 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=30a72f02870;p=xen.git tools: fix error path of xenhypfs_open() In case of an error in xenhypfs_open() the error path will cause a segmentation fault due to a wrong sequence of closing calls. Reported-by: Andrew Cooper Fixes: 86234eafb9529 ("libs: add libxenhypfs") Signed-off-by: Juergen Gross Reviewed-by: Paul Durrant Release-acked-by: Paul Durrant Acked-by: Wei Liu --- diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c index c91e165705..fc23b02586 100644 --- a/tools/libs/hypfs/core.c +++ b/tools/libs/hypfs/core.c @@ -74,8 +74,8 @@ xenhypfs_handle *xenhypfs_open(xentoollog_logger *logger, return fshdl; err: - xtl_logger_destroy(fshdl->logger_tofree); xencall_close(fshdl->xcall); + xtl_logger_destroy(fshdl->logger_tofree); free(fshdl); return NULL; }