Skip to content

Commit 9a5f764

Browse files
authored
CWE-404: Improper Resource Shutdown or Release fix. (#208)
1 parent 630c50b commit 9a5f764

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ExtentReports/Reporter/Config/InteractiveReporterConfig.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ public class InteractiveReporterConfig : FileReporterConfig
2525
protected void SaveResourceToDisk(string resourceStreamPath, string savePath)
2626
{
2727
var stream = this.GetType().Assembly.GetManifestResourceStream(resourceStreamPath);
28-
var text = new StreamReader(stream).ReadToEnd();
29-
File.WriteAllText(savePath, text);
28+
using (var sr = new StreamReader(stream))
29+
{
30+
var text = sr.ReadToEnd();
31+
File.WriteAllText(savePath, text);
32+
}
3033
}
3134

3235
protected void SaveBinaryResourceToDisk(string resourceStreamPath, string savePath)

0 commit comments

Comments
 (0)