AP_TempCalibration: Remove pointer check before delete

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2021-02-03 11:13:58 -03:00 committed by Peter Barker
parent 12cd138030
commit 61bcbfea14
1 changed files with 1 additions and 3 deletions

View File

@ -93,9 +93,7 @@ void AP_TempCalibration::setup_learning(void)
learn_temp_step = 0.25;
learn_count = 200;
learn_i = 0;
if (learn_values != nullptr) {
delete [] learn_values;
}
delete [] learn_values;
learn_values = new float[learn_count];
if (learn_values == nullptr) {
return;