From ba293084e3456df8cd3907d99e21e7e3ca019c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 3 Feb 2021 11:13:58 -0300 Subject: [PATCH] SITL: Remove pointer check before delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/SITL/SIM_FlightAxis.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/SITL/SIM_FlightAxis.cpp b/libraries/SITL/SIM_FlightAxis.cpp index 10ecfbb49b..a69087b3b0 100644 --- a/libraries/SITL/SIM_FlightAxis.cpp +++ b/libraries/SITL/SIM_FlightAxis.cpp @@ -155,9 +155,8 @@ bool FlightAxis::soap_request_start(const char *action, const char *fmt, ...) va_end(ap); // open SOAP socket to FlightAxis - if (sock) { - delete sock; - } + delete sock; + sock = new SocketAPM(false); if (!sock->connect(controller_ip, controller_port)) { ::printf("connect failed\n");