summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorOto Šťáva <oto.stava@nic.cz>2024-05-15 14:46:00 +0200
committerOto Šťáva <oto.stava@nic.cz>2024-05-15 14:46:00 +0200
commitbf2377df5432eb74d176b7979b0cae76db42e1a3 (patch)
treeef836cbf7447f9c63b9413a559df0bb58ba66e36 /modules
parentMerge 'origin/master' into 6.0 - last merge before rename (diff)
downloadknot-resolver-bf2377df5432eb74d176b7979b0cae76db42e1a3.tar.xz
knot-resolver-bf2377df5432eb74d176b7979b0cae76db42e1a3.zip
daemon, lib, modules: trivial fixes for Coverity issues
Diffstat (limited to 'modules')
-rw-r--r--modules/stats/stats.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/stats/stats.c b/modules/stats/stats.c
index d0386738..4f2fb405 100644
--- a/modules/stats/stats.c
+++ b/modules/stats/stats.c
@@ -383,6 +383,8 @@ static int list_entry(const char *key, uint32_t key_len, trie_val_t *val, void *
JsonNode *sup = json_find_member(ctx->root, sup_key_nt);
if (!sup) {
sup = json_mkobject();
+ if (kr_fails_assert(sup))
+ return 0;
json_append_member(ctx->root, sup_key_nt, sup);
}
if (kr_fails_assert(sup))
@@ -411,6 +413,8 @@ static char* stats_list(void *env, struct kr_module *module, const char *args)
JsonNode *sup = json_find_member(root, elm->sup_key);
if (!sup) {
sup = json_mkobject();
+ if (kr_fails_assert(sup))
+ break;
json_append_member(root, elm->sup_key, sup);
}
if (kr_fails_assert(sup))