summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2016-07-22 13:15:58 +0530
committerNiels de Vos <ndevos@redhat.com>2016-08-01 02:01:17 -0700
commit56ed983c2d4cbfaffefb404e21db766007629400 (patch)
treefd4a4fc8cf659532f59055204d180f3e065d4a4b
parent07d7dec8ec307e68cf8f9690174ef0e9c6497085 (diff)
gfapi/upcall: Fix a ref leak
inode_find (used to create the handle) takes a reference of the inode. This needs to be un'refernced to avoid leak. This is backport of below master patch - http://review.gluster.org/14984 >Change-Id: I22f03577a8f1d9608cfc62d57202cfc4c2ba12b3 >BUG: 1358608 >Signed-off-by: Soumya Koduri <skoduri@redhat.com> >Reviewed-on: http://review.gluster.org/14984 >Reviewed-by: jiffin tony Thottan <jthottan@redhat.com> >Reviewed-by: Jeff Darcy <jdarcy@redhat.com> >(cherry picked from commit bb48eb46910085928efbd7fb491c5b2db25bba98) Change-Id: I92701af8a948d982fd4dbe31af32334c1bb26347 BUG: 1361665 Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/15049 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Niels de Vos <ndevos@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--api/src/glfs-handleops.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs-handleops.c b/api/src/glfs-handleops.c
index 1c5546ec427..2b436f9bc4d 100644
--- a/api/src/glfs-handleops.c
+++ b/api/src/glfs-handleops.c
@@ -1843,6 +1843,10 @@ glfs_h_find_handle (struct glfs *fs, unsigned char *handle, int len)
gf_uuid_copy (object->gfid, object->inode->gfid);
out:
+ /* inode_find takes a reference. Unref it. */
+ if (newinode)
+ inode_unref (newinode);
+
glfs_subvol_done (fs, subvol);
__GLFS_EXIT_FS;