summaryrefslogtreecommitdiff
path: root/modules/pam_env
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-02-08 18:07:59 +0100
committerChristian Göttsche <cgzones@googlemail.com>2023-02-28 15:11:18 +0100
commit81e74d598b080de5c6a66585ebf2a9d6d1186f00 (patch)
tree8430c04cbba25cc8a6fce14446152c5116ed0325 /modules/pam_env
parent8a3f0810397c992a1155d815b1dd40b0b8fed59d (diff)
pam_env: override undefined pointer after asprintf failure
On failure the content of the string pointer passed to asprintf(3) is undefined. Set to NULL before free'ing the parent array.
Diffstat (limited to 'modules/pam_env')
-rw-r--r--modules/pam_env/pam_env.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index a25e195b..2868cfce 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -265,6 +265,7 @@ econf_read_file(const pam_handle_t *pamh, const char *filename, const char *deli
pam_syslog(pamh, LOG_ERR, "Cannot allocate memory.");
econf_free(keys);
econf_freeFile(key_file);
+ (*lines)[i] = NULL;
free_string_array(*lines);
free (val);
return PAM_BUF_ERR;