aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2021-01-21 16:07:25 -0500
committerTheodore Ts'o <tytso@mit.edu>2021-01-21 16:07:25 -0500
commit32c2b19945676367db636bb23d57cac7d46cb8c5 (patch)
tree57ef5c93a5a3f8bcf8db53ba468afb75fe63d66f
parent12c415fb0bf4aba496d5be0516e75a54bfca6c54 (diff)
downloade2fsprogs-32c2b19945676367db636bb23d57cac7d46cb8c5.tar.gz
tune2fs: fix resource leak in handle_quota_options()
Addresses-Coverity-Bug: 1467672 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r--misc/tune2fs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index a481d8f31..48b8ce857 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1619,6 +1619,8 @@ static int handle_quota_options(ext2_filsys fs)
com_err(program_name, retval,
_("while updating quota limits (%d)"),
qtype);
+ quota_errout:
+ quota_release_context(&qctx);
return 1;
}
}
@@ -1627,7 +1629,7 @@ static int handle_quota_options(ext2_filsys fs)
com_err(program_name, retval,
_("while writing quota file (%d)"),
qtype);
- return 1;
+ goto quota_errout;
}
/* Enable Quota feature if one of quota enabled */
if (!ext2fs_has_feature_quota(fs->super)) {
@@ -1645,7 +1647,7 @@ static int handle_quota_options(ext2_filsys fs)
com_err(program_name, retval,
_("while removing quota file (%d)"),
qtype);
- return 1;
+ goto quota_errout;
}
if (qtype == PRJQUOTA) {
ext2fs_clear_feature_project(fs->super);