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

From: Denis V. Lunev (den@asplinux.ru)
Date: Tue Apr 01 2003 - 08:16:37 EST


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/



This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 22:00:13 EST