Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efc42799 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix memory leak in OTA verifier code" am: 65162cd9

parents a53fa18a 65162cd9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;