lkml.org 
[lkml]   [2003]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMemleak in Windows Logical Disk Manager partition handler
Hello!

Not freeing allocated memory on error exit path.
See the patch.
Should apply to both 2.4 and 2.5.
Found with help of smatch + enhanced unfree script.

Bye,
Oleg

===== fs/partitions/ldm.c 1.6 vs edited =====
--- 1.6/fs/partitions/ldm.c Mon Aug 12 00:08:42 2002
+++ edited/fs/partitions/ldm.c Sun Mar 9 23:38:15 2003
@@ -1223,8 +1223,10 @@
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) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.018 / U:1.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site