summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 5b1666c425b..e8404860fa8 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -6195,8 +6195,11 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic
ret = posix_pstat (this, gfid, hpath, &stbuf);
- if (ret == -1)
+ if (ret == -1) {
+ if (inode)
+ inode_unref (inode);
continue;
+ }
if (!inode)
inode = inode_find (itable, stbuf.ia_gfid);