From 4d9625be61359133c883656ac1925b09997d0ad6 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 11 Jul 2024 21:07:53 +0200 Subject: [PATCH] fix segfault due to missing LinkTable allocation LinkTable_new dereferences a NULL linktbl pointer when it does not load the link table from disk. It needs to allocate the new LinkTable object. Fixes: 07475660f1f7 ("updated LinkTable invalidation") --- src/link.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/link.c b/src/link.c index 4c08486..8228fda 100644 --- a/src/link.c +++ b/src/link.c @@ -607,6 +607,7 @@ LinkTable *LinkTable_new(const char *url) * disk */ if (!linktbl) { + linktbl = LinkTable_alloc(url); linktbl->index_time = time(NULL); lprintf(debug, "linktbl->index_time: %d\n", linktbl->index_time);