Removes unnecessary memory allocation in Lenovo USB Controller

This commit is contained in:
Peter Vazny
2022-12-16 18:07:20 +00:00
committed by Adam Honse
parent e1a6a74ba7
commit 120ce6abbd

View File

@@ -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
{