From cdaa73a1ff29ef946aaddaf4a4f47dd5c4aa06e6 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Fri, 17 Nov 2023 11:21:12 -0800 Subject: [PATCH] AP_Networking: init socket null check --- libraries/AP_Networking/AP_Networking_port.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_Networking/AP_Networking_port.cpp b/libraries/AP_Networking/AP_Networking_port.cpp index a476218955c0a9..17d2785a44fa3c 100644 --- a/libraries/AP_Networking/AP_Networking_port.cpp +++ b/libraries/AP_Networking/AP_Networking_port.cpp @@ -78,6 +78,9 @@ void AP_Networking::Port::udp_client_init(const uint32_t size_rx, const uint32_t if (!init_buffers(size_rx, size_tx)) { return; } + if (sock != nullptr) { + return false; + } sock = new SocketAPM(true); if (sock == nullptr) { return;