public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Memleak in Windows Logical Disk Manager partition handler
@ 2003-03-09 20:41 Oleg Drokin
  0 siblings, 0 replies; only message in thread
From: Oleg Drokin @ 2003-03-09 20:41 UTC (permalink / raw)
  To: alan, linux-kernel; +Cc: torvalds

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) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-09 20:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-09 20:41 Memleak in Windows Logical Disk Manager partition handler Oleg Drokin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox