summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2009-05-19 04:33:37 +0000
committerAnand V. Avati <avati@amp.gluster.com>2009-05-19 21:13:22 +0530
commitacf28ed1ef3565ca1321fe9647d9b065a24fa46a (patch)
tree6824f4dbe119256a173079683c89a1a1b3d217bd
parentd71a5601fb2cf661d973a08a4cef9a15a9ec2363 (diff)
mem-pool: Fix memory leak in mem-pool init phase
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
-rw-r--r--libglusterfs/src/mem-pool.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
index bc6bf158eaf..a6b3339bacf 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));