summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumya Koduri <skoduri@redhat.com>2017-01-12 14:19:31 +0530
committerJeff Darcy <jdarcy@redhat.com>2017-01-12 07:47:23 -0800
commit84271e12efb783bfc83133329b0fd18aba729c84 (patch)
tree43514617f29aff5367b3d5a6a8e94a27e9b3cad0
parent5b24934668adb89e1dcd3888ac19555056508f06 (diff)
Upcall: Fix possible memleak when inode_ctx_set fails
In __upcall_inode_ctx_set(), if inode_ctx_set fails we should free allocated memory for ctx. This patch takes care of the same. Change-Id: Iafb42787151a579caf6f396c9b414ea48d16e6b4 BUG: 1412489 Reported-by: Nithya Balachandran <nbalacha@redhat.com> Signed-off-by: Soumya Koduri <skoduri@redhat.com> Reviewed-on: http://review.gluster.org/16381 Reviewed-by: N Balachandran <nbalacha@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
-rw-r--r--xlators/features/upcall/src/upcall-internal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c
index 84bde25ad58..f290ca11de8 100644
--- a/xlators/features/upcall/src/upcall-internal.c
+++ b/xlators/features/upcall/src/upcall-internal.c
@@ -183,6 +183,7 @@ __upcall_inode_ctx_set (inode_t *inode, xlator_t *this)
if (ret) {
gf_log (this->name, GF_LOG_DEBUG,
"failed to set inode ctx (%p)", inode);
+ GF_FREE (inode_ctx);
goto out;
}