From: Lukas Czerner <lczerner@redhat.com>
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 [thread overview]
Message-ID: <1290599198-5280-1-git-send-email-lczerner@redhat.com> (raw)
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 <lczerner@redhat.com>
---
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,
--
1.7.2.3
reply other threads:[~2010-11-24 11:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1290599198-5280-1-git-send-email-lczerner@redhat.com \
--to=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).