From 974e208b404a8a4f1df006082030f4d3bf884c1e Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Tue, 14 Jul 2015 17:41:07 +0100 Subject: [PATCH] libxl: avoid leaking in libxl__initiate_device_remove Change "return" to "goto out_success" to correctly dispose of the structure. Signed-off-by: Wei Liu Acked-by: Ian Jackson --- tools/libxl/libxl_device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c index 2493972424..bee5ed564b 100644 --- a/tools/libxl/libxl_device.c +++ b/tools/libxl/libxl_device.c @@ -816,7 +816,7 @@ void libxl__initiate_device_remove(libxl__egc *egc, be_path); goto out; } - return; + goto out_success; } } @@ -868,6 +868,7 @@ void libxl__initiate_device_remove(libxl__egc *egc, goto out; } +out_success: libxl_dominfo_dispose(&info); return; -- 2.39.5