From 30f88d5fcfe58cbeb35cbaea342e6f0b9ad4cc81 Mon Sep 17 00:00:00 2001 From: Gabriel Marcano Date: Wed, 5 May 2021 02:07:19 -0700 Subject: [PATCH] Fix mismatched new[] / delete - The device description buffer was allocated using new[] in RGBController. Make sure to free it using delete[]. --- NetworkServer.cpp | 2 +- ProfileManager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NetworkServer.cpp b/NetworkServer.cpp index eacdf6e4..61d7f450 100644 --- a/NetworkServer.cpp +++ b/NetworkServer.cpp @@ -834,7 +834,7 @@ void NetworkServer::SendReply_ControllerData(SOCKET client_sock, unsigned int de send(client_sock, (const char *)&reply_hdr, sizeof(NetPacketHeader), 0); send(client_sock, (const char *)reply_data, reply_size, 0); - delete reply_data; + delete[] reply_data; } } diff --git a/ProfileManager.cpp b/ProfileManager.cpp index 36c0ae5f..246b199f 100644 --- a/ProfileManager.cpp +++ b/ProfileManager.cpp @@ -77,7 +77,7 @@ bool ProfileManager::SaveProfile(std::string profile_name, bool sizes) controller_file.write((const char *)controller_data, controller_size); - delete controller_data; + delete[] controller_data; } /*---------------------------------------------------------*\