]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
libxc: fix leak in xc_offline_page error path
authorHarmandeep Kaur <write.harmandeep@gmail.com>
Wed, 10 Feb 2016 11:19:38 +0000 (16:49 +0530)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Feb 2016 15:07:43 +0000 (15:07 +0000)
Avoid leaking the mapping of the m2p in one of the possible failure cases.

Coverity CID 1351225

Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_offline_page.c

index bc91d51483c7614528990890da139d9886ff568e..3248a345a044fc78fae4ed7d21322d3c8da061cd 100644 (file)
@@ -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 */