FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.

» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

LinkBack Thread Tools
Old 11-06-2011, 09:20 PM
Jesper Juhl
Default dm-ioctl: Don't leak memory in target_message() if 'argc' is NULL

If 'argc' is NULL we'll jump to the 'out:' label, but this will leak
the memory that 'dm_split_args()' allocated for 'argv', so we should
be jumping to the 'out_argv:' label instead to free up that
memory. This patch does so.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
drivers/md/dm-ioctl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

note: compile tested only.

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 31c2dc2..1ce84ed 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1437,7 +1437,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)

if (!argc) {
DMWARN("Empty message received.");
- goto out;
+ goto out_argv;

table = dm_get_live_table(md);

Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

dm-devel mailing list

Thread Tools

All times are GMT. The time now is 07:25 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org