diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2022-05-26 05:07:10 +0200 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-26 05:07:10 +0200 |
commit | 6bb8a685b581b73124a6b0cef56d76bcfbadd99d (patch) | |
tree | 1a47d1bd6d5097c6435fd270bc3aafcff2c224b1 | |
parent | Import translations. DO NOT MERGE ANYWHERE (diff) | |
parent | Merge "Fix memory leak in OTA verifier code" am: 65162cd9b0 am: efc4279944 am: 6e0b7fa5ec am: 1ec805514b (diff) | |
download | android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar.gz android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar.bz2 android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar.lz android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar.xz android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.tar.zst android_bootable_recovery-6bb8a685b581b73124a6b0cef56d76bcfbadd99d.zip |
-rw-r--r-- | otautil/verifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/otautil/verifier.cpp b/otautil/verifier.cpp index 8a65566ec..83ad7082b 100644 --- a/otautil/verifier.cpp +++ b/otautil/verifier.cpp @@ -309,13 +309,15 @@ int verify_file(VerifierInterface* package, const std::vector<Certificate>& keys } static std::vector<Certificate> IterateZipEntriesAndSearchForKeys(const ZipArchiveHandle& handle) { - void* cookie; + void* cookie{}; + int32_t iter_status = StartIteration(handle, &cookie, "", "x509.pem"); if (iter_status != 0) { LOG(ERROR) << "Failed to iterate over entries in the certificate zipfile: " << ErrorCodeString(iter_status); return {}; } + std::unique_ptr<void, decltype(&EndIteration)> cookie_guard(cookie, &EndIteration); std::vector<Certificate> result; |