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

[Xen-devel] [PATCH v3] dom variable error handled in Xenstore



xc_dom_allocate function in build function in init-xenstore-domain.c returns 
NULL on failure. 
In that case, variable rv is set to ENOMEM and directed to failure path err.  

Signed-off-by: Lasya Venneti <comethalley61@xxxxxxxxx>

---
 tools/xenstore/init-xenstore-domain.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/xenstore/init-xenstore-domain.c 
b/tools/xenstore/init-xenstore-domain.c
index 0d12169..82ddabb 100644
--- a/tools/xenstore/init-xenstore-domain.c
+++ b/tools/xenstore/init-xenstore-domain.c
@@ -42,6 +42,10 @@ static int build(xc_interface *xch, int argc, char** argv)
        snprintf(cmdline, 512, "--event %d --internal-db", rv);
 
        dom = xc_dom_allocate(xch, cmdline, NULL);
+       if (dom == NULL) {
+               rv = ENOMEM;
+               goto err;
+       }
        rv = xc_dom_kernel_file(dom, argv[1]);
        if (rv) goto err;
 
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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