From: Harmandeep Kaur Date: Wed, 10 Feb 2016 11:19:38 +0000 (+0530) Subject: libxc: fix leak in xc_offline_page error path X-Git-Tag: colo-prep-v8-base~117 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3163a0822c7192b2f57c517dcfddaeabda776197;p=people%2Fliuw%2Fxen.git libxc: fix leak in xc_offline_page error path Avoid leaking the mapping of the m2p in one of the possible failure cases. Coverity CID 1351225 Signed-off-by: Harmandeep Kaur Reviewed-by: Dario Faggioli Acked-by: Ian Jackson --- diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index bc91d51483..3248a345a0 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xc_offline_page.c @@ -504,7 +504,7 @@ int xc_exchange_page(xc_interface *xch, int domid, xen_pfn_t mfn) if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { PERROR("Could not map domain's memory information\n"); - return -1; + goto failed; } /* For translation macros */