summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2011-07-06 02:18:49 +0000
committerAnand Avati <avati@gluster.com>2011-07-11 23:19:00 -0700
commitb320532ca74643108df399663e3c002af3e0e219 (patch)
tree7a4927155795ea0ad16a960aaf8aede00ab2c1f0
parent500813986241a8b5f6ff0658f4471a8f58e6c48e (diff)
fd: put the fd back to fd_mem_pool of inode table instead of freeing in case of failure
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3103 (memleak in inode table creation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3103
-rw-r--r--libglusterfs/src/fd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
index 1e65f2d82..bbb774be4 100644
--- a/libglusterfs/src/fd.c
+++ b/libglusterfs/src/fd.c
@@ -521,7 +521,7 @@ fd_create (inode_t *inode, pid_t pid)
fd->_ctx = GF_CALLOC (1, (sizeof (struct _fd_ctx) * fd->xl_count),
gf_common_mt_fd_ctx);
if (!fd->_ctx) {
- GF_FREE (fd);
+ mem_put (inode->table->fd_mem_pool, fd);
fd = NULL;
goto out;
}