libxc: Fix out-of-memory error handling in xc_cpupool_getinfo()

Avoid freeing info then returning it to the caller.

This is XSA-88.

Coverity-ID: 1056192
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
(cherry picked from commit d883c179a7)
This commit is contained in:
Andrew Cooper authored and Ian Jackson committed 2014-02-12 16:54:31 +00:00
1 parent ae5d69f1c6
commit eba76e4112
1 file changed
+1
+1
View File
@@ -104,6 +104,7 @@ xc_cpupoolinfo_t *xc_cpupool_getinfo(xc_interface *xch,
info->cpumap = xc_cpumap_alloc(xch);
if (!info->cpumap) {
free(info);
info = NULL;
goto out;
}
info->cpupool_id = sysctl.u.cpupool_op.cpupool_id;
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.