From 8cb65650117569dadf5c764f72e5cfb292efb5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Filipensk=C3=BD?= Date: Wed, 11 May 2022 12:06:22 +0200 Subject: [PATCH] ctdb: Covscan: unchecked return value for trbt_traversearray32() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pavel Filipenský Reviewed-by: Jeremy Allison Reviewed-by: Douglas Bagnall --- ctdb/server/ipalloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ctdb/server/ipalloc.c b/ctdb/server/ipalloc.c index bacbdb32aee..7f4936439da 100644 --- a/ctdb/server/ipalloc.c +++ b/ctdb/server/ipalloc.c @@ -96,6 +96,7 @@ create_merged_ip_list(struct ipalloc_state *ipalloc_state) struct public_ip_list *ip_list; struct ctdb_public_ip_list *public_ips; struct trbt_tree *ip_tree; + int ret; ip_tree = trbt_create(ipalloc_state, 0); @@ -138,7 +139,11 @@ create_merged_ip_list(struct ipalloc_state *ipalloc_state) } ip_list = NULL; - trbt_traversearray32(ip_tree, IP_KEYLEN, getips_count_callback, &ip_list); + ret = trbt_traversearray32(ip_tree, IP_KEYLEN, getips_count_callback, &ip_list); + if (ret != 0) { + DBG_ERR("Error traversing the IP tree.\n"); + } + talloc_free(ip_tree); return ip_list;