(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,10 +260,18 @@ NextEntry:
} }
} }
var arc = new ArcFile (file, this, dir); var arc = new ArcFile (file, this, dir);
try
{
if (crypt_algorithm.IsValueCreated) if (crypt_algorithm.IsValueCreated)
crypt_algorithm.Value.Init (arc); crypt_algorithm.Value.Init (arc);
return arc; return arc;
} }
catch
{
arc.Dispose();
throw;
}
}
static readonly Regex ObfuscatedPathRe = new Regex (@"[^\\/]+[\\/]\.\.[\\/]"); static readonly Regex ObfuscatedPathRe = new Regex (@"[^\\/]+[\\/]\.\.[\\/]");