From 40ebee1cb15ba8c43ec0b5fff506e3aa68fce584 Mon Sep 17 00:00:00 2001 From: rafern <15365765+rafern@users.noreply.github.com> Date: Tue, 1 Oct 2019 09:10:31 +0100 Subject: [PATCH] Update BluetoothSerial.cpp (#3308) --- 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 a8332b8b..d3d09216 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");