2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 05:48:18 +00:00

Avoid calling fclose(NULL) on error in export_sudoers().

Coverity CID 104091.
This commit is contained in:
Todd C. Miller 2016-05-05 15:14:57 -06:00
parent a09e45d339
commit c0a3c6bb9d

View File

@ -1062,7 +1062,7 @@ export_sudoers(const char *sudoers_path, const char *export_path,
fputs("\n}\n", export_fp);
done:
if (export_fp != stdout)
if (export_fp != stdout && export_fp != NULL)
fclose(export_fp);
debug_return_bool(ok);
}