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