]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
shutup clang scan
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 19 May 2020 23:12:56 +0000 (18:12 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 19 May 2020 23:15:49 +0000 (18:15 -0500)
src/modules/proto_arp/proto_arp_ethernet.c
src/modules/proto_control/proto_control_tcp.c
src/modules/proto_dhcpv4/proto_dhcpv4_udp.c
src/modules/proto_dhcpv6/proto_dhcpv6_udp.c
src/modules/proto_radius/proto_radius_load.c
src/modules/proto_radius/proto_radius_tcp.c
src/modules/proto_radius/proto_radius_udp.c
src/modules/proto_vmps/proto_vmps_udp.c

index 3c5b072ad834819b89f34bbf2a5ab91cc58d3dfe..5ba967996385bc28b15b4309bf974e0fc5d392d5 100644 (file)
@@ -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;
index 4803402878c88a95a362bbcda49b3962734afa15..9875888c44b2659c86aaa32c60e90b5184afc07d 100644 (file)
@@ -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);
index bd6d5e2b41657aa6644b8a642460a17a8a9081db..7bf686e09da02f20555738f24ea4b6cc1305b4b0 100644 (file)
@@ -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,
index 4caf3f6ec833a88b526980e16dd5bfbb8572943e..8f836f1b9039483e563614e2dd4dbbfdc41dcc9d 100644 (file)
@@ -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,
index b4cbfe24663effb7b46719912304b863f0c57995..57a258360c045667cc43278e07e1b3425d733fcd 100644 (file)
@@ -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);
 
index 488e7084583b70a5a7973e0123bb3a8b1f2373b9..e8d045ab1f8a7449ec4ec7ef46b57c31cae2d4de 100644 (file)
@@ -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,
index 20c923f07c2eda0b3dcf03213372c151f48cdad8..0b345267ef89b4a30d35310ffa271b490f3c7646 100644 (file)
@@ -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);
 
index d44c96dba0d910c0378cefe4b61176e7049e78d1..d7ffb96b8bc39239128acda7c138c572c4c5976c 100644 (file)
@@ -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,