From 77f609d74b134fc93890aa57d5f1f8eb8e770e39 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Sun, 10 Dec 2023 16:03:52 +0900
Subject: [PATCH] network/neighbor: add missing OOM check

(cherry picked from commit be26893c85b7200d41440792928f5ebbf06fa8cb)
(cherry picked from commit 3411c8a42a60816187aa8dce7c4282af001473d6)
(cherry picked from commit 4abd97bc53d25cdb7948ed7065f6a62415fbec1d)
(cherry picked from commit 10b20d61b4cb2089464fffda11318576f0511455)

Conflict:NA
Reference:https://github.com/systemd/systemd/commit/be26893c85b7200d41440792928f5ebbf06fa8cb
---
 src/network/networkd-neighbor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/network/networkd-neighbor.c b/src/network/networkd-neighbor.c
index f0f78b9c4a..ee40a3ccc5 100644
--- a/src/network/networkd-neighbor.c
+++ b/src/network/networkd-neighbor.c
@@ -502,6 +502,8 @@ int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message,
         }
 
         tmp = new0(Neighbor, 1);
+        if (!tmp)
+                return log_oom();
 
         r = sd_rtnl_message_neigh_get_family(message, &tmp->family);
         if (r < 0) {
-- 
2.33.0

