From 71a33809c107f36efb034c854e8451569cf90caa Mon Sep 17 00:00:00 2001 From: rafern <15365765+rafern@users.noreply.github.com> Date: Mon, 30 Sep 2019 21:50:19 +0100 Subject: [PATCH] Update BluetoothSerial.cpp --- libraries/BluetoothSerial/src/BluetoothSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/BluetoothSerial/src/BluetoothSerial.cpp b/libraries/BluetoothSerial/src/BluetoothSerial.cpp index a8332b8bc99..d3d09216303 100644 --- a/libraries/BluetoothSerial/src/BluetoothSerial.cpp +++ b/libraries/BluetoothSerial/src/BluetoothSerial.cpp @@ -136,12 +136,12 @@ static void _spp_tx_task(void * arg){ if(len){ memcpy(_spp_tx_buffer, data, len); _spp_tx_buffer_len += len; - free(packet); - packet = NULL; if(uxQueueMessagesWaiting(_spp_tx_queue) == 0){ _spp_send_buffer(); } } + free(packet); + packet = NULL; } } else { log_e("Something went horribly wrong");