diff --git a/src/tofu.c b/src/tofu.c
index e8efeaf69fcb9bd890711f76959e86efa75cfec6..354e211c856451bdea120bbb1aed5917099eb285 100644
--- a/src/tofu.c
+++ b/src/tofu.c
@@ -31,6 +31,7 @@ //
// TODO: Check that the subject name is valid for the requested URL.
struct gemini_tofu *tofu = (struct gemini_tofu *)data;
X509 *cert = X509_STORE_CTX_get0_cert(ctx);
+ struct known_host *host = NULL;
int rc;
int day, sec;
@@ -77,7 +78,7 @@ time_t now;
time(&now);
enum tofu_error error = TOFU_UNTRUSTED_CERT;
- struct known_host *host = tofu->known_hosts;
+ host = tofu->known_hosts;
while (host) {
if (host->expires < now) {
goto next;