From dcfdad0036f121b26da1e9ef479f5dbe32765cb7 Mon Sep 17 00:00:00 2001 From: Soumya Koduri Date: Thu, 12 Jan 2017 14:19:31 +0530 Subject: 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. This is backport of below mainline fix. http://review.gluster.org/16381 >Change-Id: Iafb42787151a579caf6f396c9b414ea48d16e6b4 >BUG: 1412489 >Reported-by: Nithya Balachandran >Signed-off-by: Soumya Koduri >Reviewed-on: http://review.gluster.org/16381 >Reviewed-by: N Balachandran >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Jeff Darcy >(cherry picked from commit 84271e12efb783bfc83133329b0fd18aba729c84) Change-Id: Ia258f3fb12b92795aa7546708c6da5c91f70a08a BUG: 1414655 Reported-by: Nithya Balachandran Signed-off-by: Soumya Koduri Reviewed-on: https://review.gluster.org/16431 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: N Balachandran NetBSD-regression: NetBSD Build System Reviewed-by: Niels de Vos --- xlators/features/upcall/src/upcall-internal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xlators/features/upcall/src/upcall-internal.c b/xlators/features/upcall/src/upcall-internal.c index 66cbddf5fa9..37fc3dbc35a 100644 --- a/xlators/features/upcall/src/upcall-internal.c +++ b/xlators/features/upcall/src/upcall-internal.c @@ -204,6 +204,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; } -- cgit