From be9f2fce28c75e8b700c56c37c7e4c2386f726ec Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Tue, 5 Dec 2023 08:00:00 +0000 Subject: pam_pwhistory: fix memory leak on error path * modules/pam_pwhistory/pwhistory_config.c (parse_config_file): Free the result returned by pam_modutil_search_key when it becomes unused. --- modules/pam_pwhistory/pwhistory_config.c | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/pam_pwhistory') diff --git a/modules/pam_pwhistory/pwhistory_config.c b/modules/pam_pwhistory/pwhistory_config.c index 692cf80e..2f299b54 100644 --- a/modules/pam_pwhistory/pwhistory_config.c +++ b/modules/pam_pwhistory/pwhistory_config.c @@ -124,6 +124,7 @@ parse_config_file(pam_handle_t *pamh, int argc, const char **argv, if (*val != '/') { pam_syslog (pamh, LOG_ERR, "File path should be absolute: %s", val); + free(val); } else { options->filename = val; } -- cgit v1.2.3