aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_pwhistory
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@strace.io>2023-12-05 08:00:00 +0000
committerDmitry V. Levin <ldv@strace.io>2023-12-05 21:47:16 +0000
commitbe9f2fce28c75e8b700c56c37c7e4c2386f726ec (patch)
tree826bb72c01df5274eb0d8346132f84d7ebedf486 /modules/pam_pwhistory
parentebf711d1504258a21753738f99464701b9c719ac (diff)
downloadpam-be9f2fce28c75e8b700c56c37c7e4c2386f726ec.tar.gz
pam-be9f2fce28c75e8b700c56c37c7e4c2386f726ec.tar.bz2
pam-be9f2fce28c75e8b700c56c37c7e4c2386f726ec.zip
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.
Diffstat (limited to 'modules/pam_pwhistory')
-rw-r--r--modules/pam_pwhistory/pwhistory_config.c1
1 files changed, 1 insertions, 0 deletions
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;
}