From 010394ee5e237606023f455955e005e111b9fa5b Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Tue, 28 Dec 2010 01:13:45 +0000 Subject: xlator.c: Unrefing inode's on error in loc_copy. Signed-off-by: Junaid Signed-off-by: Anand V. Avati BUG: 2252 (unreffing of inodes not done when memory allocation fails) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2252 --- libglusterfs/src/xlator.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 67ee32874..986b533df 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -1188,6 +1188,13 @@ loc_copy (loc_t *dst, loc_t *src) ret = 0; out: + if (ret == -1) { + if (dst->inode) + inode_unref (dst->inode); + + if (dst->parent) + inode_unref (dst->parent); + } return ret; } -- cgit