Invalid read fixed (thanks Valgrind)

This commit is contained in:
Bertrand Songis
2016-02-29 19:03:47 +01:00
parent 301cd0538b
commit c6a04394c5
+1 -1
View File
@@ -507,7 +507,7 @@ bool menuScreenSetup(int index, evt_t event)
const LayoutFactory * factory = editThemeChoice<const LayoutFactory>(SCREENS_SETUP_2ND_COLUMN, y, registeredLayouts, countRegisteredLayouts, currentScreen->getFactory(), needsOffsetCheck, attr, event);
if (factory) {
delete customScreens[index];
customScreens[index] = factory->create(&g_model.screenData[index].layoutData);
currentScreen = customScreens[index] = factory->create(&g_model.screenData[index].layoutData);
strncpy(g_model.screenData[index].layoutName, factory->getName(), sizeof(g_model.screenData[index].layoutName));
storageDirty(EE_MODEL);
}