From f77a946ad947045a04a8be0989379b2c5b7d0e8e Mon Sep 17 00:00:00 2001 From: Xi Jinyu Date: Tue, 14 Jan 2020 22:29:06 -0500 Subject: Fix possible resource leaks. xlators/features/quota/src/quota.c quota_log_usage function. The quota_log_helper() function applies memory for path through inode_path(), should be GF_FREE(). Upstream Patch: https://review.gluster.org/#/c/glusterfs/+/24018/ Backport of: > fixes: bz#1792707 > Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5 > Signed-off-by: Xi Jinyu > (cherry picked from commit 18549de12bcfafe4ac30fc2e11ad7a3f3c216b38) fixes: bz#1791154 Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5 Signed-off-by: Signed-off-by: Sunny Kumar --- xlators/features/quota/src/quota.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index c014c99cbd2..9a8352252a4 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -4951,6 +4951,9 @@ quota_log_usage(xlator_t *this, quota_inode_ctx_t *ctx, inode_t *inode, ctx->prev_log = cur_time; } + if (path) + GF_FREE(path); + if (usage_str) GF_FREE(usage_str); } -- cgit