(Xp3Opener): dispose of archive in case of encryption plugin initialization error.

This commit is contained in:
morkt 2016-03-08 17:13:22 +04:00
parent 977d4f215f
commit 7c10d0a874

View File

@ -260,9 +260,17 @@ NextEntry:
}
}
var arc = new ArcFile (file, this, dir);
if (crypt_algorithm.IsValueCreated)
crypt_algorithm.Value.Init (arc);
return arc;
try
{
if (crypt_algorithm.IsValueCreated)
crypt_algorithm.Value.Init (arc);
return arc;
}
catch
{
arc.Dispose();
throw;
}
}
static readonly Regex ObfuscatedPathRe = new Regex (@"[^\\/]+[\\/]\.\.[\\/]");