From 2186b332d8bcba29f715ab8147f751d2a5726fc7 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Fri, 3 Mar 2023 14:40:01 +0530 Subject: [PATCH] LU-16614 lfs: Fix memory leak Fix memory leak while running "lfs check all" Before patch: ============= $ valgrind --leak-check=full lfs check all ==93768== LEAK SUMMARY: ==93768== definitely lost: 56 bytes in 2 blocks ==93768== indirectly lost: 282 bytes in 5 blocks ==93768== possibly lost: 0 bytes in 0 blocks ==93768== still reachable: 0 bytes in 0 blocks ==93768== suppressed: 0 bytes in 0 blocks After patch: ============= $ valgrind --leak-check=full lfs check all HEAP SUMMARY: in use at exit: 0 bytes in 0 blocks total heap usage: 98 allocs, 98 frees, 294,999 bytes allocated All heap blocks were freed -- no leaks are possible Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: Ib39d1f89a9c6937668f2a7d515606c7df86ac1df Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50196 Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/utils/liblustreapi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index b2d4f83..80c062b 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -6393,6 +6393,7 @@ int llapi_target_iterate(int type_num, char **obd_type, fclose(fp); fp = NULL; } + cfs_free_param_data(¶m); } free_path: if (fp) -- 1.8.3.1