Signed-off-by: Lasya Venneti <comethalle...@gmail.com>
---
 tools/xenstore/init-xenstore-domain.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tools/xenstore/init-xenstore-domain.c 
b/tools/xenstore/init-xenstore-domain.c
index 0d12169..b413b09 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;
 
@@ -70,7 +74,8 @@ static int build(xc_interface *xch, int argc, char** argv)
        if (rv) goto err;
        rv = xc_domain_unpause(xch, domid);
        if (rv) goto err;
-
+       
+       close(xs_fd);
        return 0;
 
 err:
-- 
1.9.1


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

Reply via email to