[f2fs-dev] [PATCH] f2fs-tools:fix memory leak in write dquot

From: Xiaojun Wang
Date: Wed Apr 24 2019 - 02:43:30 EST


this patch free ddquot in qtree_write_dquot to avoid memory leak

Signed-off-by: Xiaojun Wang <wangxiaojun11@xxxxxxxxxx>
---
fsck/quotaio_tree.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/fsck/quotaio_tree.c b/fsck/quotaio_tree.c
index ebee862..de25a60 100644
--- a/fsck/quotaio_tree.c
+++ b/fsck/quotaio_tree.c
@@ -353,6 +353,7 @@ int qtree_write_dquot(struct dquot *dquot)
if (ret != info->dqi_entry_size) {
log_err("Quota write failed (id %u): %s",
(unsigned int)dquot->dq_id, strerror(errno));
+ quota_free_mem(&ddquot);
return ret;
}
quota_free_mem(&ddquot);
--
2.7.4