From patchwork Wed Feb 10 09:09:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harmandeep Kaur X-Patchwork-Id: 8269051 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BEDE69F3CD for ; Wed, 10 Feb 2016 09:12:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C5DD20254 for ; Wed, 10 Feb 2016 09:12:30 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3252E2026C for ; Wed, 10 Feb 2016 09:12:29 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTQmr-0000yl-1g; Wed, 10 Feb 2016 09:10:13 +0000 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: from [193.109.254.147] by server-13.bemta-14.messagelabs.com id 83/7B-08347-27EFAB65; Wed, 10 Feb 2016 09:10:10 +0000 X-Env-Sender: write.harmandeep@gmail.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1455095408!22748036!1 X-Originating-IP: [209.85.192.171] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58490 invoked from network); 10 Feb 2016 09:10:09 -0000 Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by server-10.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 10 Feb 2016 09:10:09 -0000 Received: by mail-pf0-f171.google.com with SMTP id c10so9157142pfc.2 for ; Wed, 10 Feb 2016 01:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=KplobeHh1Ns885eZFc7PXnxp5jBlgg324QLvOvBPpA0=; b=HPqNCQ/DEhzDlX/mLwvN2Mlx+X87Zn9T/uwdttoK4wNdoGWqhjyCZCHuZBTiztuv3J E8sTSXJXvlrcqa+cqIRDZvPPDL9ckQ4o+mky+MNF9TD6xN2cu2jtd7Y21/vMIKxRBdTe Wjsu2UPgMOUOAveGi8bTcbhvvztHjdGbLMFTtzhFxhV7S0/NvwgsWJX9Z3tdWj+0LtEg uUrs+EfYe+6kmZluljMqB0etz87d0B0NsIyQFbXhjNZYW8ZsId5Av/n3l9yGEvEWNFFx 5zExkJHqPHoB2w+EF/4M0Uu+Ucuvm2sfCKfui2Z/WcZ9AV0Sfeo2BmWSHFaCMgt2fNeA bCtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KplobeHh1Ns885eZFc7PXnxp5jBlgg324QLvOvBPpA0=; b=PW61d0uCIfcO2AU1s+lDE3vOBJ14VUltqsIIV+ZUmW3HBcqzibDBSbgRgaUPD+sF9o 1LCVCisO5Cm5SfrOEdg8ZlUACwhE7RRuikZ8H1My6YgikaOHlDGpKhPogUGTP/6RuzIs lYX5l5k9dYV2TxEievjuwpOG6BrTiXDcPMjUF1r1ORI0JtbfDHSISvAOULymJiRKL5rz e+uCVO+3aO/FGkErVmG8sOdCO1mnsMw5e8jDahwVbWI+tGeMvAJyoJ7KAfJ4WZEQ+T/Q fTaL/23yiVckGu8eBKuPn7ZP+YAbSgFddPKFmgsLER19Csd37YNOUeEqEj0B8iS0+ets wuRg== X-Gm-Message-State: AG10YORtKdhZpyOAvEzUtXfFo9x/DGzaj2jFkVJ/rwUS5+r5U9a+Z+ef3qIypVOXprA/ZQ== X-Received: by 10.98.64.83 with SMTP id n80mr56925102pfa.149.1455095408410; Wed, 10 Feb 2016 01:10:08 -0800 (PST) Received: from localhost.localdomain ([124.253.125.61]) by smtp.googlemail.com with ESMTPSA id n84sm3453251pfa.45.2016.02.10.01.10.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 01:10:07 -0800 (PST) From: Harmandeep Kaur To: xen-devel@lists.xenproject.org Date: Wed, 10 Feb 2016 14:39:45 +0530 Message-Id: <1455095385-3120-1-git-send-email-write.harmandeep@gmail.com> X-Mailer: git-send-email 2.5.0 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 Subject: [Xen-devel] [PATCH] libxc: Fix CID 1351228 resource leak X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }