]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/neighbor: add missing OOM check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 10 Dec 2023 07:03:52 +0000 (16:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 11 Dec 2023 06:07:54 +0000 (15:07 +0900)
src/network/networkd-neighbor.c

index e9986567ac7a0b92f41874f26e31e3654cdd514f..62d6f324c07a2608d3b5c8021ae907181d49ea22 100644 (file)
@@ -530,6 +530,8 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
                 return 0;
 
         tmp = new0(Neighbor, 1);
+        if (!tmp)
+                return log_oom();
 
         /* First, retrieve the fundamental information about the neighbor. */
         r = sd_rtnl_message_neigh_get_family(message, &tmp->family);