libxc: fix leak in xc_dom_load_hvm_kernel error path

Error path in xc_dom_load_hvm_kernel needs to use the 'error' label instead
of directly returning. This is needed so the entries local variable is
freed.

Coverity-ID: 1351227
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Roger Pau Monne authored and Ian Campbell committed 2016-02-03 11:22:13 +00:00
1 parent 21e19ae558
commit e260c1c905
1 file changed
+3 -3
+3 -3
View File
@@ -257,7 +257,7 @@ static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
if ( rc < 0 )
{
DOMPRINTF("%s: failed to load elf binary", __func__);
return rc;
goto error;
}
munmap(elf->dest_base, elf->dest_size);
@@ -267,14 +267,14 @@ static elf_errorstatus xc_dom_load_hvm_kernel(struct xc_dom_image *dom)
if ( rc != 0 )
{
DOMPRINTF("%s: insufficient space to load modules.", __func__);
return rc;
goto error;
}
rc = loadmodules(dom, m_start, m_end, dom->guest_domid);
if ( rc != 0 )
{
DOMPRINTF("%s: unable to load modules.", __func__);
return rc;
goto error;
}
dom->parms.phys_entry = elf_uval(elf, elf->ehdr, e_entry);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.