From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harmandeep Kaur Subject: [PATCH v2] libxc: fix leak in xc_offline_page error path Date: Wed, 10 Feb 2016 16:49:38 +0530 Message-ID: <1455103178-3959-1-git-send-email-write.harmandeep@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 1aTSod-0001Hh-1M for xen-devel@lists.xenproject.org; Wed, 10 Feb 2016 11:20:11 +0000 Received: by mail-pf0-f195.google.com with SMTP id w128so243135pfb.2 for ; Wed, 10 Feb 2016 03:20:08 -0800 (PST) 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 Cc: wei.liu2@citrix.com, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Harmandeep Kaur List-Id: xen-devel@lists.xenproject.org Avoid leaking the mapping of the m2p in one of the possible failure cases. Coverity CID 1351225 Signed-off-by: Harmandeep Kaur --- v2: update commit message and changelog --- tools/libxc/xc_offline_page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c index bc91d51..3248a34 100644 --- a/tools/libxc/xc_offline_page.c +++ b/tools/libxc/xc_offline_page.c @@ -504,7 +504,7 @@ int xc_exchange_page(xc_interface *xch, int domid, xen_pfn_t mfn) if ( xc_map_domain_meminfo(xch, domid, &minfo) ) { PERROR("Could not map domain's memory information\n"); - return -1; + goto failed; } /* For translation macros */ -- 2.5.0