From patchwork Mon May 30 21:19:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Trofimovich X-Patchwork-Id: 830972 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4ULKLdx006032 for ; Mon, 30 May 2011 21:20:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754346Ab1E3VUS (ORCPT ); Mon, 30 May 2011 17:20:18 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:54962 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753957Ab1E3VUR (ORCPT ); Mon, 30 May 2011 17:20:17 -0400 Received: from gentoo.org (unknown [178.125.169.231]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 2D6551B4010; Mon, 30 May 2011 21:20:14 +0000 (UTC) Received: by gentoo.org (sSMTP sendmail emulation); Tue, 31 May 2011 00:20:10 +0300 From: Sergei Trofimovich To: Chris Mason Cc: linux-btrfs@vger.kernel.org, Sergei Trofimovich Subject: [PATCH 7/9] mkfs.btrfs: free buffers allocated by pretty_sizes Date: Tue, 31 May 2011 00:19:06 +0300 Message-Id: <1306790348-9553-8-git-send-email-slyfox@gentoo.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1306790348-9553-1-git-send-email-slyfox@gentoo.org> References: <1306790348-9553-1-git-send-email-slyfox@gentoo.org> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 30 May 2011 21:20:21 +0000 (UTC) found by valgrind: ==2559== 16 bytes in 1 blocks are definitely lost in loss record 3 of 19 ==2559== at 0x4C2720E: malloc (vg_replace_malloc.c:236) ==2559== by 0x412F7E: pretty_sizes (utils.c:1054) ==2559== by 0x4179E9: main (mkfs.c:1395) Signed-off-by: Sergei Trofimovich --- mkfs.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/mkfs.c b/mkfs.c index 32f25f5..c8b19c1 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1176,6 +1176,7 @@ int main(int ac, char **av) char *output = "output.img"; u64 num_of_meta_chunks = 0; u64 size_of_data = 0; + char * pretty_buf; while(1) { int c; @@ -1395,7 +1396,8 @@ raid_groups: printf("fs created label %s on %s\n\tnodesize %u leafsize %u " "sectorsize %u size %s\n", label, first_file, nodesize, leafsize, sectorsize, - pretty_sizes(btrfs_super_total_bytes(&root->fs_info->super_copy))); + pretty_buf = pretty_sizes(btrfs_super_total_bytes(&root->fs_info->super_copy))); + free (pretty_buf); printf("%s\n", BTRFS_BUILD_VERSION); btrfs_commit_transaction(trans, root);