2
0
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:
Todd C. Miller 2016-05-05 15:01:22 -06:00
parent 5725acd1c4
commit 64142f9da2

View File

@ -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);