[PATCH] memory leak in mem_read(fs/proc/base.c), 2.4.20

Denis V. Lunev (den@asplinux.ru)
Tue, 1 Apr 2003 17:16:37 +0400


Hello!

- memory leak found if error occured, allocated page is not freed

Regards,
Denis V. Lunev

--- linux/fs/proc/base.c~ Thu Mar 27 12:18:36 2003
+++ linux/fs/proc/base.c Tue Apr 1 15:16:49 2003
@@ -311,10 +311,13 @@
if (mm)
atomic_inc(&mm->mm_users);
task_unlock(task);
- if (!mm)
+ if (!mm) {
+ free_page((unsigned long)page);
return 0;
+ }

if (file->private_data != (void*)((long)current->self_exec_id) ) {
+ free_page((unsigned long)page);
mmput(mm);
return -EIO;
}
-
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/