linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] init/do_mounts_rd.c memory leak
@ 2003-05-23 19:12 Hollis Blanchard
  0 siblings, 0 replies; only message in thread
From: Hollis Blanchard @ 2003-05-23 19:12 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

Another potential memory leak the Stanford checker caught at 2.5.48: 
while closing and opening floppy disks, buf could be allocated and 
never freed.

-- 
Hollis Blanchard
IBM Linux Technology Center


[-- Attachment #2: mount-rd-free.diff --]
[-- Type: application/octet-stream, Size: 501 bytes --]

--- init/do_mounts_rd.c.orig	2003-05-15 15:05:56.000000000 -0500
+++ init/do_mounts_rd.c	2003-05-15 15:06:30.000000000 -0500
@@ -206,12 +206,14 @@
 			rotate = 0;
 			if (close(in_fd)) {
 				printk("Error closing the disk.\n");
+				kfree(buf);
 				goto noclose_input;
 			}
 			change_floppy("disk #%d", disk);
 			in_fd = open(from, O_RDONLY, 0);
 			if (in_fd < 0)  {
 				printk("Error opening disk.\n");
+				kfree(buf);
 				goto noclose_input;
 			}
 			printk("Loading disk #%d... ", disk);

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

only message in thread, other threads:[~2003-05-23 18:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-23 19:12 [PATCH] init/do_mounts_rd.c memory leak Hollis Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).