mirror of https://github.com/Icinga/icinga2.git
Fix CA2202 code analysis warning in the Windows wizard
This commit is contained in:
parent
979b99ea6f
commit
98d81ffc85
|
@ -83,10 +83,16 @@ namespace Icinga
|
||||||
|
|
||||||
private void EnableFeature(string feature)
|
private void EnableFeature(string feature)
|
||||||
{
|
{
|
||||||
using (FileStream fp = File.Open(Icinga2InstallDir + String.Format("\\etc\\icinga2\\features-enabled\\{0}.conf", feature), FileMode.Create)) {
|
FileStream fp = null;
|
||||||
|
try {
|
||||||
|
fp = File.Open(Icinga2InstallDir + String.Format("\\etc\\icinga2\\features-enabled\\{0}.conf", feature), FileMode.Create);
|
||||||
using (StreamWriter sw = new StreamWriter(fp, Encoding.ASCII)) {
|
using (StreamWriter sw = new StreamWriter(fp, Encoding.ASCII)) {
|
||||||
|
fp = null;
|
||||||
sw.Write(String.Format("include \"../features-available/{0}.conf\"\n", feature));
|
sw.Write(String.Format("include \"../features-available/{0}.conf\"\n", feature));
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (fp != null)
|
||||||
|
fp.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue