[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/domain: fix memory leak in domain_create()



commit 3491e85a15058e87f0166c179282954c434e9acf
Author:     Denis Mukhin <dmukhin@xxxxxxxx>
AuthorDate: Mon Jun 23 10:50:33 2025 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Jun 23 10:50:33 2025 +0200

    xen/domain: fix memory leak in domain_create()
    
    Fix potential memory leak in domain_create() in late hardware domain case.
    
    Fixes: b959f3b820f5 ("xen: introduce hardware domain create flag")
    Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
 xen/common/domain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 434d32901b..8c8f70347a 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -825,7 +825,10 @@ struct domain *domain_create(domid_t domid,
 
         /* late_hwdom is only allowed for dom0. */
         if ( hardware_domain && hardware_domain->domain_id )
+        {
+            free_domain_struct(d);
             return ERR_PTR(-EINVAL);
+        }
 
         old_hwdom = hardware_domain;
         hardware_domain = d;
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.