From acf28ed1ef3565ca1321fe9647d9b065a24fa46a Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Tue, 19 May 2009 04:33:37 +0000 Subject: mem-pool: Fix memory leak in mem-pool init phase Signed-off-by: Anand V. Avati --- libglusterfs/src/mem-pool.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c index bc6bf158e..a6b3339ba 100644 --- a/libglusterfs/src/mem-pool.c +++ b/libglusterfs/src/mem-pool.c @@ -56,8 +56,10 @@ mem_pool_new_fn (unsigned long sizeof_type, mem_pool->cold_count = count; pool = CALLOC (count, sizeof_type + pad); - if (!pool) + if (!pool) { + FREE (mem_pool); return NULL; + } for (i = 0; i < count; i++) { list = pool + (i * (sizeof_type + pad)); -- cgit