summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2010-12-28 01:13:45 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-29 10:20:42 -0800
commit010394ee5e237606023f455955e005e111b9fa5b (patch)
treef56d1ee0829ae5ac9d1128b08d6b7ea15a7a444d /libglusterfs
parent03c791e2d699574dae077d05a171a768bfb28ec3 (diff)
xlator.c: Unrefing inode's on error in loc_copy.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2252 (unreffing of inodes not done when memory allocation fails) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2252
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/xlator.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 67ee3287402..986b533df2a 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;
}