]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Memleak in Windows Logical Disk Manager partition
authorAndrew Morton <akpm@digeo.com>
Mon, 10 Mar 2003 15:42:15 +0000 (07:42 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 10 Mar 2003 15:42:15 +0000 (07:42 -0800)
Patch from Oleg Drokin <green@linuxhacker.ru>

   Not freeing allocated memory on error exit path.

fs/partitions/ldm.c

index e0d448b3a6c9a13224955ba6f0abf0926ace10a8..4d51456360cf8653cd30a6bfd9ee68352b168c54 100644 (file)
@@ -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) {