From 5ad50246c0ecd9e704dbd26be4e19e0571721016 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Thu, 16 Feb 2023 22:38:29 -0500 Subject: [PATCH] LU-16568 lfs: call Parser_exit() at lfs/lctl exit Call Parser_exit() before lfs and lctl cleanly exit to free memory allocated in Parser_init() via strdup(). Test-Parameters: trivial fstype=zfs testlist=sanity Signed-off-by: Arshad Hussain Change-Id: I1bc86d4b17f62a545e51fb3e479b2576e6362c42 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50039 Reviewed-by: Jian Yu Reviewed-by: jsimmons Reviewed-by: Oleg Drokin Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/utils/lctl.c | 1 + lustre/utils/lfs.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lustre/utils/lctl.c b/lustre/utils/lctl.c index cb694b9..260deab 100644 --- a/lustre/utils/lctl.c +++ b/lustre/utils/lctl.c @@ -664,6 +664,7 @@ int lctl_main(int argc, char **argv) } obd_finalize(argc, argv); + Parser_exit(argc, argv); return rc < 0 ? -rc : rc; } diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 197ccee..47e6541 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -13130,6 +13130,8 @@ int main(int argc, char **argv) rc = Parser_commands(); } + Parser_exit(argc, argv); + return rc < 0 ? -rc : rc; } -- 1.8.3.1