From 120ce6abbdd3bafdfce2ebce282344a4874329f0 Mon Sep 17 00:00:00 2001 From: Peter Vazny Date: Fri, 16 Dec 2022 18:07:20 +0000 Subject: [PATCH] Removes unnecessary memory allocation in Lenovo USB Controller --- Controllers/LenovoControllers/RGBController_LenovoUSB.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp b/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp index 5c6396a3..c0a7624d 100644 --- a/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp +++ b/Controllers/LenovoControllers/RGBController_LenovoUSB.cpp @@ -306,12 +306,7 @@ void RGBController_LenovoUSB::SetupZones() new_zone.matrix_map = new matrix_map_type; new_zone.matrix_map->height = lenovo_zones[i].height; new_zone.matrix_map->width = lenovo_zones[i].width; - new_zone.matrix_map->map = new unsigned int[new_zone.matrix_map->height * new_zone.matrix_map->width]; - - if(lenovo_zones[i].matrix_map != NULL) - { - new_zone.matrix_map->map = (unsigned int *) lenovo_zones[i].matrix_map; - } + new_zone.matrix_map->map = (unsigned int *) lenovo_zones[i].matrix_map; } else {