From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harmandeep Kaur Subject: [PATCH] libxc: Fix CID 1351228 resource leak Date: Wed, 10 Feb 2016 14:39:45 +0530 Message-ID: <1455095385-3120-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 1aTQmp-0000yZ-Ds for xen-devel@lists.xenproject.org; Wed, 10 Feb 2016 09:10:11 +0000 Received: by mail-pf0-f171.google.com with SMTP id c10so9157142pfc.2 for ; Wed, 10 Feb 2016 01:10:09 -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 Signed-off-by: Harmandeep Kaur --- tools/libxc/xc_tbuf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c index 695939a..f06f566 100644 --- a/tools/libxc/xc_tbuf.c +++ b/tools/libxc/xc_tbuf.c @@ -70,9 +70,13 @@ int xc_tbuf_get_size(xc_interface *xch, unsigned long *size) sysctl.u.tbuf_op.buffer_mfn); if ( t_info == NULL || t_info->tbuf_size == 0 ) + { + xenforeignmemory_unmap(xch->fmem, t_info, 0); return -1; + } *size = t_info->tbuf_size; + xenforeignmemory_unmap(xch->fmem, t_info, *size); return 0; } -- 2.5.0