From b69ffd3479d2eaf40c0df56100c4ca0042bc162e Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 28 Dec 2022 10:50:51 -0700 Subject: [PATCH] sudoers_policy_main: plug memory leak of iolog_path on error. --- plugins/sudoers/sudoers.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index bd5822d9f..84ac21221 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -853,6 +853,9 @@ done: if (ret == -1) { /* Free stashed copy of the environment. */ (void)env_init(NULL); + + /* Free locally-allocated strings. */ + free(iolog_path); } else { /* Store settings to pass back to front-end. */ if (!sudoers_policy_store_result(ret, NewArgv, env_get(), cmnd_umask,