From patchwork Wed Nov 24 11:46:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Czerner X-Patchwork-Id: 72839 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 5507EB6EEB for ; Wed, 24 Nov 2010 22:47:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753946Ab0KXLqr (ORCPT ); Wed, 24 Nov 2010 06:46:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:22173 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753945Ab0KXLqq (ORCPT ); Wed, 24 Nov 2010 06:46:46 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAOBkiSh020533 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 24 Nov 2010 06:46:45 -0500 Received: from dhcp-lab-213.englab.brq.redhat.com (vpn-11-145.rdu.redhat.com [10.11.11.145]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAOBkgPG007489; Wed, 24 Nov 2010 06:46:43 -0500 From: Lukas Czerner To: tytso@mit.edu Cc: linux-ext4@vger.kernel.org, lczerner@redhat.com Subject: [PATCH] e2fsprogs: fix possible mem-leak in ext2fs_free_generic_bmap() Date: Wed, 24 Nov 2010 12:46:38 +0100 Message-Id: <1290599198-5280-1-git-send-email-lczerner@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ext2fs_free_generic_bmap is supposed to free the ext2fs_generic_bitmap structure, however it frees just the memory allocated to the members of the structure but not the memory allocated for the structure itself. This commit fixes it with simple oneliner by adding free() at the end of the ext2fs_free_generic_bmap(). Signed-off-by: Lukas Czerner --- lib/ext2fs/gen_bitmap64.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lib/ext2fs/gen_bitmap64.c b/lib/ext2fs/gen_bitmap64.c index 9f23b92..f46f048 100644 --- a/lib/ext2fs/gen_bitmap64.c +++ b/lib/ext2fs/gen_bitmap64.c @@ -158,6 +158,7 @@ void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap) bmap->description = 0; } bmap->magic = 0; + free(bmap); } errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src,