[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1111062318090.5763@swampdragon.chaosbits.net>
Date: Sun, 6 Nov 2011 23:20:14 +0100 (CET)
From: Jesper Juhl <jj@...osbits.net>
To: dm-devel@...hat.com, linux-raid@...r.kernel.org,
linux-kernel@...r.kernel.org
cc: Neil Brown <neilb@...e.de>
Subject: [PATCH] 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@...osbits.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);
--
1.7.7.2
--
Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists