From patchwork Tue Dec 30 14:57:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 5552661 Return-Path: X-Original-To: patchwork-linux-btrfs@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 EFD509F2B9 for ; Tue, 30 Dec 2014 14:57:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 435E420172 for ; Tue, 30 Dec 2014 14:57:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FF2420160 for ; Tue, 30 Dec 2014 14:57:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbaL3O5o (ORCPT ); Tue, 30 Dec 2014 09:57:44 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50399 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbaL3O5m (ORCPT ); Tue, 30 Dec 2014 09:57:42 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7D216ABFC for ; Tue, 30 Dec 2014 14:57:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id ED852DA88A; Tue, 30 Dec 2014 15:57:40 +0100 (CET) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 2/5] btrfs-progs: fi show, don't leak canonical path Date: Tue, 30 Dec 2014 15:57:40 +0100 Message-Id: <8499af348407909801cf87c6e1e7426c930ae567.1419951036.git.dsterba@suse.cz> 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: 1260252 Signed-off-by: David Sterba --- cmds-filesystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmds-filesystem.c b/cmds-filesystem.c index 80875fffddfe..1c1d34ae8ca2 100644 --- a/cmds-filesystem.c +++ b/cmds-filesystem.c @@ -471,7 +471,6 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info, char *canonical_path; tmp_dev_info = (struct btrfs_ioctl_dev_info_args *)&dev_info[i]; - canonical_path = canonicalize_path((char *)tmp_dev_info->path); /* Add check for missing devices even mounted */ fd = open((char *)tmp_dev_info->path, O_RDONLY); @@ -480,6 +479,7 @@ static int print_one_fs(struct btrfs_ioctl_fs_info_args *fs_info, continue; } close(fd); + canonical_path = canonicalize_path((char *)tmp_dev_info->path); printf("\tdevid %4llu size %s used %s path %s\n", tmp_dev_info->devid, pretty_size(tmp_dev_info->total_bytes),