Memory leaks in system.certificates implementation due to possible exception. Example:
https://github.com/ClickHouse/ClickHouse/pull/37142/files#diff-1e24e43bfc38cec9770c3cc831b14d045c8138a60d7b77de8d32d96f4a2387e7R110

ref #37142
{
    static const RE2 cert_name("^[a-fA-F0-9]{8}\\.\\d$");
    assert(cert_name.ok());
    const std::filesystem::path p(dir);
    for (auto const& dir_entry : std::filesystem::directory_iterator(p))
    {
        if (!dir_entry.is_regular_file() || !RE2::FullMatch(dir_entry.path().filename().string(), cert_name))
            continue;
        Poco::Crypto::X509Certificate cert(dir_entry.path());
        populateTable(cert.certificate(), res_columns, dir_entry.path(), def);
    }
}
#endif
void StorageSystemCertificates::fillData([[maybe_unused]] MutableColumns & res_columns, ContextPtr, const SelectQueryInfo &) const
{
#if USE_SSL
    const auto & ca_paths = Poco::Net::SSLManager::instance().defaultServerContext()->getCAPaths();
    if (!ca_paths.caLocation.empty())
    {
        Poco::File afile(ca_paths.caLocation);
        if (afile.exists())
        {
            if (afile.isDirectory())
            {
                auto dir_set = parse_dir(ca_paths.caLocation);
                for (const auto & entry : dir_set)