Merge pull request #11564 from Mailaender/coverity-zipfile
Fixed undisposed file and memory streams in ZipFile and surroundings
This commit is contained in:
@@ -137,6 +137,9 @@ namespace OpenRA.FileSystem
|
|||||||
{
|
{
|
||||||
if (pkg != null)
|
if (pkg != null)
|
||||||
pkg.Close();
|
pkg.Close();
|
||||||
|
|
||||||
|
if (pkgStream != null)
|
||||||
|
pkgStream.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,8 @@ namespace OpenRA
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
package = new ZipFile(File.OpenRead(pair.Second), pair.Second);
|
using (var fileStream = File.OpenRead(pair.Second))
|
||||||
|
package = new ZipFile(fileStream, pair.Second);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user