[PATCH] fix memory leak in mm/slab.c::alloc_kmemlist()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Coverity checker found that we may leak memory in 
mm/slab.c::alloc_kmemlist()
This should fix the leak and coverity bug #589


Signed-off-by: Jesper Juhl <[email protected]>
---

 mm/slab.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- linux-2.6.16-rc6-orig/mm/slab.c	2006-03-12 14:19:17.000000000 +0100
+++ linux-2.6.16-rc6/mm/slab.c	2006-03-12 14:22:40.000000000 +0100
@@ -3366,8 +3366,10 @@ static int alloc_kmemlist(struct kmem_ca
 			continue;
 		}
 		if (!(l3 = kmalloc_node(sizeof(struct kmem_list3),
-					GFP_KERNEL, node)))
+					GFP_KERNEL, node))) {
+			kfree(new);
 			goto fail;
+		}
 
 		kmem_list3_init(l3);
 		l3->next_reap = jiffies + REAPTIMEOUT_LIST3 +


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux