From 0f3b450d9be25b63911d33a9df2d1ee0216e4670 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 Mar 2003 07:42:15 -0800 Subject: [PATCH] [PATCH] Memleak in Windows Logical Disk Manager partition Patch from Oleg Drokin Not freeing allocated memory on error exit path. --- fs/partitions/ldm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c index e0d448b3a6c9a..4d51456360cf8 100644 --- a/fs/partitions/ldm.c +++ b/fs/partitions/ldm.c @@ -1162,8 +1162,10 @@ static BOOL ldm_ldmdb_add (u8 *data, int len, struct ldmdb *ldb) return FALSE; } - if (!ldm_parse_vblk (data, len, vb)) + if (!ldm_parse_vblk (data, len, vb)) { + kfree(vb); return FALSE; /* Already logged */ + } /* Put vblk into the correct list. */ switch (vb->type) { -- 2.53.0