diff options
author | Shehjar Tikoo <shehjart@gluster.com> | 2009-05-19 04:33:37 +0000 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-19 21:13:22 +0530 |
commit | acf28ed1ef3565ca1321fe9647d9b065a24fa46a (patch) | |
tree | 6824f4dbe119256a173079683c89a1a1b3d217bd /libglusterfs/src | |
parent | d71a5601fb2cf661d973a08a4cef9a15a9ec2363 (diff) |
mem-pool: Fix memory leak in mem-pool init phase
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r-- | libglusterfs/src/mem-pool.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)); |