diff --git a/libraries/AP_Networking/AP_Networking_port.cpp b/libraries/AP_Networking/AP_Networking_port.cpp index a476218955c0a..17d2785a44fa3 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;