summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Junaid Ahmed <junaid@gluster.com>2010-12-28 01:14:19 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-29 10:20:46 -0800
commit165efc45ab5518033612a58c1ac51243eb6bcef8 (patch)
treece63a87e5e11f7663211818006fd3088ae0ac2f4
parent010394ee5e237606023f455955e005e111b9fa5b (diff)
nfs/server: unrefing inodes on error in nfs_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
-rw-r--r--xlators/nfs/server/src/nfs-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index ef2d1d3..f109cdde 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -187,6 +187,14 @@ nfs_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;
}