Merge "idmap2: ZipFile::Open: fix potential memory leak"

This commit is contained in:
TreeHugger Robot
2019-10-01 16:27:33 +00:00
committed by Android (Google) Code Review

View File

@@ -34,6 +34,7 @@ std::unique_ptr<const ZipFile> ZipFile::Open(const std::string& path) {
::ZipArchiveHandle handle;
int32_t status = ::OpenArchive(path.c_str(), &handle);
if (status != 0) {
::CloseArchive(handle);
return nullptr;
}
return std::unique_ptr<ZipFile>(new ZipFile(handle));