mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-30 05:48:18 +00:00
Avoid calling fclose(NULL) if the sudoers file is not secure and
restore_perms() fails. Coverity CID 104090.
This commit is contained in:
parent
5725acd1c4
commit
64142f9da2
@ -939,8 +939,10 @@ open_sudoers(const char *sudoers, bool doedit, bool *keepopen)
|
||||
|
||||
if (!restore_perms()) {
|
||||
/* unable to change back to root */
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
if (fp != NULL) {
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
debug_return_ptr(fp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user