]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Fix theoretical memory leak when parsing routes
authorTobias Brunner <tobias@strongswan.org>
Fri, 25 Jun 2021 11:51:44 +0000 (13:51 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 25 Jun 2021 11:51:44 +0000 (13:51 +0200)
This currently can't happen as the kernel always puts RTA_TABLE as first
attribute in RTM_NEWROUTE messages.

src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index 278ea647b7ad0720cf93cd5246962c61e67062c9..a25b7840c0c5201ad07f5aa415779e181c8e0bff 100644 (file)
@@ -1372,6 +1372,7 @@ static void process_route(private_kernel_netlink_net_t *this,
                                if (RTA_PAYLOAD(rta) == sizeof(uint32_t) &&
                                        this->routing_table == *(uint32_t*)RTA_DATA(rta))
                                {
+                                       DESTROY_IF(host);
                                        return;
                                }
                                break;