From 30a72f028707d8cdc7951b50268e33818497596e Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Tue, 9 Jun 2020 16:48:49 +0200 Subject: [PATCH] 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 --- tools/libs/hypfs/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5