Merge pull request #11564 from Mailaender/coverity-zipfile

Fixed undisposed file and memory streams in ZipFile and surroundings
This commit is contained in:
abcdefg30
2016-07-03 14:22:36 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -137,6 +137,9 @@ namespace OpenRA.FileSystem
{
if (pkg != null)
pkg.Close();
if (pkgStream != null)
pkgStream.Dispose();
}
}

View File

@@ -47,7 +47,8 @@ namespace OpenRA
{
try
{
package = new ZipFile(File.OpenRead(pair.Second), pair.Second);
using (var fileStream = File.OpenRead(pair.Second))
package = new ZipFile(fileStream, pair.Second);
}
catch
{