]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bpf: use more TAKE_FD()
authorLennart Poettering <lennart@poettering.net>
Thu, 20 Jun 2019 12:41:09 +0000 (14:41 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Jun 2019 18:28:24 +0000 (03:28 +0900)
src/core/bpf-firewall.c

index 7b9aeb6fbf418aa62f23edaf87de3b87d6ccd006..33fad30a47915131f38d8d9c7de8e18b23a45647 100644 (file)
@@ -430,10 +430,8 @@ static int bpf_firewall_prepare_access_maps(
                         return r;
         }
 
-        *ret_ipv4_map_fd = ipv4_map_fd;
-        *ret_ipv6_map_fd = ipv6_map_fd;
-
-        ipv4_map_fd = ipv6_map_fd = -1;
+        *ret_ipv4_map_fd = TAKE_FD(ipv4_map_fd);
+        *ret_ipv6_map_fd = TAKE_FD(ipv6_map_fd);
         return 0;
 }