aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xenstored_domain.c
diff options
context:
space:
mode:
authorEwan Mellor <ewan@xensource.com>2006-12-13 11:13:08 +0000
committerEwan Mellor <ewan@xensource.com>2006-12-13 11:13:08 +0000
commitc0536171422d0a82c2c958b1038c77d692bcd60b (patch)
treee76bf20ea34c2ed10e7950b9dcac1a330de71f3f /tools/xenstore/xenstored_domain.c
parent3fdae5e58f09e307cd97897ccef7481935ff8f23 (diff)
downloadxen-c0536171422d0a82c2c958b1038c77d692bcd60b.tar.gz
xen-c0536171422d0a82c2c958b1038c77d692bcd60b.tar.bz2
xen-c0536171422d0a82c2c958b1038c77d692bcd60b.zip
Check return of new_domain inside dom0_init, avoiding segfault if there is
a second instance of xenstored running (and we're using different pid files). Signed-off-by: Ewan Mellor <ewan@xensource.com>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r--tools/xenstore/xenstored_domain.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c
index d21ae7b9c7..75ff6e96d8 100644
--- a/tools/xenstore/xenstored_domain.c
+++ b/tools/xenstore/xenstored_domain.c
@@ -459,6 +459,8 @@ static int dom0_init(void)
return -1;
dom0 = new_domain(NULL, 0, port);
+ if (dom0 == NULL)
+ return -1;
dom0->interface = xenbus_map();
if (dom0->interface == NULL)