From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lasya Subject: [PATCH v3] dom variable error handled in Xenstore Date: Wed, 28 Oct 2015 05:42:23 +0530 Message-ID: <1445991143-9165-1-git-send-email-comethalley61@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zr37l-0007sw-B0 for xen-devel@lists.xenproject.org; Tue, 27 Oct 2015 12:13:09 +0000 Received: by pacfv9 with SMTP id fv9so231210983pac.3 for ; Tue, 27 Oct 2015 05:13:06 -0700 (PDT) List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, george.dunlap@citrix.com, lars.kurth@citrix.com, dario.faggioli@citrix.com, wei.liu2@citrix.com, ian.campbell@citrix.com Cc: Lasya List-Id: xen-devel@lists.xenproject.org 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 --- 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