From patchwork Fri Apr 7 10:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9669259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D9E1602B3 for ; Fri, 7 Apr 2017 10:49:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 801E928481 for ; Fri, 7 Apr 2017 10:49:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74BF928600; Fri, 7 Apr 2017 10:49:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB8C628481 for ; Fri, 7 Apr 2017 10:49:45 +0000 (UTC) Received: from localhost ([::1]:50060 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwRSa-0006Ew-5B for patchwork-qemu-devel@patchwork.kernel.org; Fri, 07 Apr 2017 06:49:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwRS0-0006Eo-LZ for qemu-devel@nongnu.org; Fri, 07 Apr 2017 06:49:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwRRx-0001vV-KN for qemu-devel@nongnu.org; Fri, 07 Apr 2017 06:49:08 -0400 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:34895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwRRx-0001vL-Eb for qemu-devel@nongnu.org; Fri, 07 Apr 2017 06:49:05 -0400 Received: by mail-pg0-x243.google.com with SMTP id g2so14719326pge.2 for ; Fri, 07 Apr 2017 03:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=TYled0CoXW7zePlR6vUFKJj/eath3ZXVhW3jFOpybII=; b=vZjds0ROE1qJnCsencEDVpeOfhMVFGgs/dkR97LG8YKIHDs5sWadWGUBj2bRAzz6UB zxt53hI5ZDhavkcdGEmFbrkG2Thau9VugC2h3RTB8aYkhVUcDsw5Q6HaC1po+24hsDNu PNeT83c3w+a/tBFWxHl1/Ly6Na1fFpDd7NNLnKJYGrq88p4+CD84Ynz2Iqe3e6ippumN IVs+VTsQyh6t2YDnToi5ma+NECNtei31UTL77Gmg3tNOBv174vtx+TB8DHOi/zZgX1sM rrOPsbJ251Cgp/MR/qKoHBjr/qRgT8ndpQqcaqgrKEYilJW+deO9VKiYb/+FKNSnFBJ4 FFBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TYled0CoXW7zePlR6vUFKJj/eath3ZXVhW3jFOpybII=; b=VYoLNMsi94wvXLkdO5xYlUnDFHju3sfoiuGw68qA/z83xst35yQB2i/zSrSdzyr1ho alPt9A5xBZF8x7Q/eLfwS75cO54UjXMAXRLSm7odMCSmb8O9KM5bI3h8kjEQIHLD3m3h F0hgiLXlqP7JjPoE62EpbzpnaDwpqqLMDr5O8p/5s6qF72xTShAAiZUDbc+UmSVntNeL eaYFTPtf5Jji2x0G9w+bWNwhsaRRz3BDcTDMH9yoRbN+FSYKqwHjrqhkV1qqN5bTs/ci By74nQg0d9fSO+lBKhHbdjKG57jWXLoVEFZe1cYx1DXHQp1LxGV73zTy2r3pXEpZXvrl u3+A== X-Gm-Message-State: AFeK/H0WIEzJm1vr14XWMtaREq9/5n6YB25N4qSW1+J3gu4ijU+teVK2Fw8G2FAWGKDwug== X-Received: by 10.98.69.141 with SMTP id n13mr39594590pfi.216.1491562144146; Fri, 07 Apr 2017 03:49:04 -0700 (PDT) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id k1sm8942788pgk.42.2017.04.07.03.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Apr 2017 03:49:03 -0700 (PDT) From: Li Qiang X-Google-Original-From: Li Qiang To: groug@kaod.org Date: Fri, 7 Apr 2017 03:48:52 -0700 Message-Id: <1491562132-69066-1-git-send-email-liqiang6-s@360.cn> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang , qemu-devel@nongnu.org, ppandit@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Free 'orig_value' in error path. Signed-off-by: Li Qiang --- hw/9pfs/9p-xattr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c index eec160b..d05c1a1 100644 --- a/hw/9pfs/9p-xattr.c +++ b/hw/9pfs/9p-xattr.c @@ -108,6 +108,7 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, g_free(name); close_preserve_errno(dirfd); if (xattr_len < 0) { + g_free(orig_value); return -1; }