diff options
author | Xi Jinyu <xijinyu@cmss.chinamobile.com> | 2020-01-14 22:29:06 -0500 |
---|---|---|
committer | Rinku Kothiya <rkothiya@redhat.com> | 2020-02-10 07:36:46 +0000 |
commit | f77a946ad947045a04a8be0989379b2c5b7d0e8e (patch) | |
tree | ac1db3b3ec3373de1999384130d9a33957a13d39 /xlators | |
parent | f4f24c8c782bf4fa601f7ef14bbf2e2b6583cd90 (diff) |
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 <xijinyu@cmss.chinamobile.com>
> (cherry picked from commit 18549de12bcfafe4ac30fc2e11ad7a3f3c216b38)
fixes: bz#1791154
Change-Id: I33143bdf272bf10837061df4a1b7b2fc146162d5
Signed-off-by: Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/quota/src/quota.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |