aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/pam_xauth/pam_xauth.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/pam_xauth/pam_xauth.c b/modules/pam_xauth/pam_xauth.c
index d5e99c9f..ed86130e 100644
--- a/modules/pam_xauth/pam_xauth.c
+++ b/modules/pam_xauth/pam_xauth.c
@@ -501,6 +501,10 @@ pam_sm_open_session (pam_handle_t *pamh, int flags UNUSED,
/* Figure out where the source user's .Xauthority file is. */
if (getenv(XAUTHENV) != NULL) {
cookiefile = strdup(getenv(XAUTHENV));
+ if (cookiefile == NULL) {
+ retval = PAM_SESSION_ERR;
+ goto cleanup;
+ }
} else {
cookiefile = malloc(strlen(rpwd->pw_dir) + 1 +
strlen(XAUTHDEF) + 1);