mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 18:27:22 +00:00
pam_xdg: Reset rv to 0
Otherwise on success it ontain the return value of asprintf.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Fixes: 2d2950c889
("pam_xdg: Check asprintf return value")
This commit is contained in:
parent
2d2950c889
commit
5acbe6d1fb
|
@ -151,6 +151,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused,
|
|||
rv = PAM_SESSION_ERR;
|
||||
goto out;
|
||||
}
|
||||
rv = 0;
|
||||
session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE);
|
||||
free(xdg_session_file);
|
||||
if (session_file >= 0)
|
||||
|
@ -272,6 +273,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused,
|
|||
rv = PAM_SESSION_ERR;
|
||||
goto out;
|
||||
}
|
||||
rv = 0;
|
||||
session_file = openat(rt_dir_prefix, xdg_session_file, 0);
|
||||
if (session_file >= 0) {
|
||||
unlinkat(rt_dir_prefix, xdg_session_file, 0);
|
||||
|
|
Loading…
Reference in a new issue