diff options
author | hari gowtham <hgowtham@redhat.com> | 2017-09-28 15:43:30 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-09-29 06:36:49 +0000 |
commit | e4784f26bf9739853379ec13d0f921ddfb954475 (patch) | |
tree | 80a21dfba738292506a4be40c771110fa1194ba0 /xlators/storage/posix/src | |
parent | a2039f3e97049806ca0847a84cc9030e31f4d008 (diff) |
Posix: fix additional inode ref
Problem: In the iteration, the inode is being ref-ed twice and
unref-ed once. this leads to ref leak.
Fix: assign the parent to the inode instead of referencing it.
Change-Id: Ib154b12d38ad68220f8f5288bbc50081beccc2b9
BUG: 1496379
Signed-off-by: hari gowtham <hgowtham@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src')
-rw-r--r-- | xlators/storage/posix/src/posix-handle.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix-handle.c b/xlators/storage/posix/src/posix-handle.c index 3c8e2417188..38e3198d812 100644 --- a/xlators/storage/posix/src/posix-handle.c +++ b/xlators/storage/posix/src/posix-handle.c @@ -224,13 +224,10 @@ posix_make_ancestryfromgfid (xlator_t *this, char *path, int pathsize, } inode_unref (*parent); - *parent = inode_ref(inode); + *parent = inode; top--; } out: - if (*parent != NULL) { - inode_unref (*parent); - } return ret; } |