]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/libxc: Don't leak foreign mappings when loading modules
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 30 Sep 2016 10:01:03 +0000 (11:01 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 30 Sep 2016 11:16:57 +0000 (12:16 +0100)
Spotted by Coverity

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_dom_core.c

index 5326d36f5f2eeb7d2790c063afc81314280b0a7f..e177667e934e14dee7264c5d402c06f20e2c77d6 100644 (file)
@@ -1119,6 +1119,7 @@ static int xc_dom_load_acpi(struct xc_dom_image *dom)
         }
 
         memcpy(ptr, dom->acpi_modules[i].data, dom->acpi_modules[i].length);
+        munmap(ptr, XC_PAGE_SIZE * num_pages);
 
         free(extents);
         i++;