Whamcloud - gitweb
LU-17000 obdclass: Fix mem leak in lcfg_setparam_client 99/59499/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Sat, 31 May 2025 06:06:53 +0000 (02:06 -0400)
committerOleg Drokin <green@whamcloud.com>
Thu, 12 Jun 2025 06:37:33 +0000 (06:37 +0000)
if call to llapi_param_get_paths() fails. tmp_path
is left unfreed.

Test-Parameters: trivial
CoverityID: 457066 ("Resource leak")
Fixes: 10a04e32 (LU-16724 ptlrpc: refactor page pools patch 3)
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: Ib8962675fcb06a4d6b1539340f4a005dd65b7e02
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59499
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/lustre_param.c

index 6b43814..926a156 100644 (file)
@@ -1604,6 +1604,7 @@ static int lcfg_setparam_client(char *func, char *buf, struct param_opts *popt)
                        fprintf(stderr,
                                "error: %s: client: param_paths '%s': %s\n",
                                jt_cmdname(func), param_name, strerror(errno));
+                       free(tmp_path);
                        goto out;
                }
                free(tmp_path);