libxc: fix memory leak in move_l3_below_4G error handling
authorMatthew Daley <mattjd@gmail.com>
Wed, 30 Oct 2013 07:51:39 +0000 (20:51 +1300)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 31 Oct 2013 21:23:38 +0000 (21:23 +0000)
...otherwise mmu gets leaked.

Coverity-ID: 1055844
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_dom_x86.c

index 7cc2ff241147dca18c32b25bbb74de0a46abed10..60fc5442cec69d30f2c68b4f662d2ff453fafdec 100644 (file)
@@ -220,7 +220,7 @@ static xen_pfn_t move_l3_below_4G(struct xc_dom_image *dom,
     {
         DOMPRINTF("%s: xc_dom_pfn_to_ptr(dom, l3pfn, 1) => NULL",
                   __FUNCTION__);
-        return l3mfn; /* our one call site will call xc_dom_panic and fail */
+        goto out; /* our one call site will call xc_dom_panic and fail */
     }
     memset(l3tab, 0, XC_DOM_PAGE_SIZE(dom));