From: Arran Cudbard-Bell Date: Tue, 19 May 2020 23:12:56 +0000 (-0500) Subject: shutup clang scan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd919523741a3a60a2d427ef76d0013ca5ebc700;p=thirdparty%2Ffreeradius-server.git shutup clang scan --- diff --git a/src/modules/proto_arp/proto_arp_ethernet.c b/src/modules/proto_arp/proto_arp_ethernet.c index 3c5b072ad83..5ba96799638 100644 --- a/src/modules/proto_arp/proto_arp_ethernet.c +++ b/src/modules/proto_arp/proto_arp_ethernet.c @@ -175,7 +175,6 @@ static int mod_open(fr_listen_t *li) proto_arp_ethernet_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_arp_ethernet_t); proto_arp_ethernet_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_arp_ethernet_thread_t); - CONF_ITEM *ci; char const *filter; char *our_filter = NULL; @@ -208,8 +207,7 @@ static int mod_open(fr_listen_t *li) li->fd = thread->pcap->fd; - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); + fr_assert(cf_parent(inst->cs) != NULL); /* listen { ... } */ thread->name = talloc_asprintf(thread, "arp on interface %s", inst->interface); return 0; diff --git a/src/modules/proto_control/proto_control_tcp.c b/src/modules/proto_control/proto_control_tcp.c index 4803402878c..9875888c44b 100644 --- a/src/modules/proto_control/proto_control_tcp.c +++ b/src/modules/proto_control/proto_control_tcp.c @@ -231,6 +231,8 @@ static int mod_open(fr_listen_t *li) inst->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + inst->name = fr_app_io_socket_name(inst, &proto_control_tcp, NULL, 0, &inst->ipaddr, inst->port); diff --git a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c index bd6d5e2b416..7bf686e09da 100644 --- a/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c +++ b/src/modules/proto_dhcpv4/proto_dhcpv4_udp.c @@ -504,6 +504,8 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = fr_app_io_socket_name(thread, &proto_dhcpv4_udp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c b/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c index 4caf3f6ec83..8f836f1b903 100644 --- a/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c +++ b/src/modules/proto_dhcpv6/proto_dhcpv6_udp.c @@ -383,6 +383,8 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = fr_app_io_socket_name(thread, &proto_dhcpv6_udp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_radius/proto_radius_load.c b/src/modules/proto_radius/proto_radius_load.c index b4cbfe24663..57a258360c0 100644 --- a/src/modules/proto_radius/proto_radius_load.c +++ b/src/modules/proto_radius/proto_radius_load.c @@ -222,6 +222,8 @@ static int mod_open(fr_listen_t *li) ipaddr.af = AF_INET; li->app_io_addr = fr_app_io_socket_addr(li, IPPROTO_UDP, &ipaddr, 0); + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = talloc_typed_asprintf(thread, "radius_load from filename %s", inst->filename ? inst->filename : "none"); thread->parent = talloc_parent(li); diff --git a/src/modules/proto_radius/proto_radius_tcp.c b/src/modules/proto_radius/proto_radius_tcp.c index 488e7084583..e8d045ab1f8 100644 --- a/src/modules/proto_radius/proto_radius_tcp.c +++ b/src/modules/proto_radius/proto_radius_tcp.c @@ -314,6 +314,8 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = fr_app_io_socket_name(thread, &proto_radius_tcp, NULL, 0, &inst->ipaddr, inst->port, diff --git a/src/modules/proto_radius/proto_radius_udp.c b/src/modules/proto_radius/proto_radius_udp.c index 20c923f07c2..0b345267ef8 100644 --- a/src/modules/proto_radius/proto_radius_udp.c +++ b/src/modules/proto_radius/proto_radius_udp.c @@ -352,6 +352,8 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = fr_app_io_socket_name(thread, &proto_radius_udp, NULL, 0, &inst->ipaddr, inst->port, @@ -482,10 +484,7 @@ static int mod_bootstrap(void *instance, CONF_SECTION *cs) } } - ci = cf_parent(inst->cs); /* listen { ... } */ - fr_assert(ci != NULL); - ci = cf_parent(ci); - fr_assert(ci != NULL); + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ server_cs = cf_item_to_section(ci); diff --git a/src/modules/proto_vmps/proto_vmps_udp.c b/src/modules/proto_vmps/proto_vmps_udp.c index d44c96dba0d..d7ffb96b8bc 100644 --- a/src/modules/proto_vmps/proto_vmps_udp.c +++ b/src/modules/proto_vmps/proto_vmps_udp.c @@ -336,6 +336,8 @@ static int mod_open(fr_listen_t *li) thread->sockfd = sockfd; + fr_assert((cf_parent(inst->cs) != NULL) && (cf_parent(cf_parent(inst->cs)) != NULL)); /* listen { ... } */ + thread->name = fr_app_io_socket_name(thread, &proto_vmps_udp, NULL, 0, &inst->ipaddr, inst->port,