From patchwork Tue Dec 30 14:57:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 5552681 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A86DCBFE6A for ; Tue, 30 Dec 2014 14:57:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E11962010E for ; Tue, 30 Dec 2014 14:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1272320160 for ; Tue, 30 Dec 2014 14:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751963AbaL3O5w (ORCPT ); Tue, 30 Dec 2014 09:57:52 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50402 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751807AbaL3O5w (ORCPT ); Tue, 30 Dec 2014 09:57:52 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 26D4FABFC for ; Tue, 30 Dec 2014 14:57:51 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id A32D6DA88A; Tue, 30 Dec 2014 15:57:50 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel Date: Tue, 30 Dec 2014 15:57:50 +0100 Message-Id: X-Mailer: git-send-email 2.1.3 In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, 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 Resolves-coverity-id: 1127098 Signed-off-by: David Sterba --- cmds-filesystem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 1c1d34ae8ca2..a3cf114fb6ac 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -516,8 +516,10 @@ static int btrfs_scan_kernel(void *search) continue; ret = get_fs_info(mnt->mnt_dir, &fs_info_arg, &dev_info_arg); - if (ret) + if (ret) { + kfree(dev_info_arg); goto out; + } if (get_label_mounted(mnt->mnt_dir, label)) { kfree(dev_info_arg);