From 1538b7296cc0a3150f33190f97dc99c9ca126322 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 22 Feb 2017 16:40:12 +0100 Subject: Fix ressources leak on error path Coverty found a path where blk_fop is not freed, thus leaking memory. The main cause is because we are using the wrong variable for errors. I do not think this is leaking anything in practice, since the error condition seems quite rare, but fixing this should remove around 15 coverty warning. Change-Id: Ida0ea59f501f0a21bd1d8119aa1a299ce655add8 BUG: 789278 Signed-off-by: Michael Scherer Reviewed-on: https://review.gluster.org/16715 Smoke: Gluster Build System Reviewed-by: soumya k CentOS-regression: Gluster Build System Tested-by: Michael Scherer NetBSD-regression: NetBSD Build System Reviewed-by: Jeff Darcy --- xlators/features/leases/src/leases.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/features/leases') diff --git a/xlators/features/leases/src/leases.h b/xlators/features/leases/src/leases.h index 443c6a22324..5dde1592fb5 100644 --- a/xlators/features/leases/src/leases.h +++ b/xlators/features/leases/src/leases.h @@ -119,7 +119,7 @@ do { \ gf_msg (this->name, GF_LOG_WARNING, ENOMEM, \ LEASE_MSG_NO_MEM, \ "Unable to create/get inode ctx"); \ - op_errno = ENOMEM; \ + ret = -ENOMEM; \ goto __out; \ } \ \ -- cgit