diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-12-20 13:49:41 +0100 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2024-12-20 13:49:41 +0100 |
commit | 4238b8c81d90fc860684f78d452fc0b70ae71bc2 (patch) | |
tree | ca9cfa087f1d3afd972e51da085067315c002235 /modules | |
parent | kr_module_load(): don't pass the_engine in module->data (diff) | |
download | knot-resolver-4238b8c81d90fc860684f78d452fc0b70ae71bc2.tar.xz knot-resolver-4238b8c81d90fc860684f78d452fc0b70ae71bc2.zip |
modules/stats: be more correct on ENOMEM
Diffstat (limited to 'modules')
-rw-r--r-- | modules/stats/stats.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/stats/stats.c b/modules/stats/stats.c index 596847d7..09a0cfdc 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 */ |