From 6d063352b668c1fdfc07941c2f7ebb7a4d28ccf6 Mon Sep 17 00:00:00 2001 From: Jesse Kaukonen Date: Fri, 1 Feb 2019 12:58:23 +0200 Subject: [PATCH] bug fix: Fix mismatching delete operator cmd.packet.data is allocated using new[] and freed using delete. Use delete[] instead. --- sdk_core/src/command_handler/command_channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk_core/src/command_handler/command_channel.cpp b/sdk_core/src/command_handler/command_channel.cpp index 55057f0..8aa951c 100644 --- a/sdk_core/src/command_handler/command_channel.cpp +++ b/sdk_core/src/command_handler/command_channel.cpp @@ -234,7 +234,7 @@ void CommandChannel::Send(const Command &command) { commands_[command.packet.seq_num] = make_pair(command, apr_time_now() + apr_time_from_msec(command.time_out)); Command &cmd = commands_[command.packet.seq_num].first; if (cmd.packet.data != NULL) { - delete cmd.packet.data; + delete[] cmd.packet.data; cmd.packet.data = NULL; cmd.packet.data_len = 0; } -- 2.52.0