From 4238b8c81d90fc860684f78d452fc0b70ae71bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 20 Dec 2024 13:49:41 +0100 Subject: [PATCH] modules/stats: be more correct on ENOMEM --- modules/stats/stats.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/stats/stats.c b/modules/stats/stats.c index 596847d7c..09a0cfdc8 100644 --- a/modules/stats/stats.c +++ b/modules/stats/stats.c @@ -624,6 +624,9 @@ int stats_init(struct kr_module *module) /* Initialize ring buffer of recently visited upstreams */ array_init(data->upstreams.q); if (array_reserve(data->upstreams.q, UPSTREAMS_COUNT) != 0) { + trie_free(data->trie); + lru_free(data->queries.frequent); + free(data); return kr_error(ENOMEM); } data->upstreams.q.len = UPSTREAMS_COUNT; /* signify we use the entries */