mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-03 07:59:38 +00:00
MACVENTURE: Fix leak on loadControls
This commit is contained in:
parent
2f2d9bead7
commit
28698ba697
@ -69,7 +69,7 @@ struct ControlData {
|
||||
ControlAction refcon;
|
||||
ControlType type;
|
||||
uint8 titleLength;
|
||||
char* title;
|
||||
Common::String title;
|
||||
uint16 border;
|
||||
};
|
||||
|
||||
|
@ -512,9 +512,11 @@ bool Gui::loadControls() {
|
||||
data.type = (ControlType)id; id++;
|
||||
data.titleLength = res->readByte();
|
||||
if (data.titleLength) {
|
||||
data.title = new char[data.titleLength + 1];
|
||||
res->read(data.title, data.titleLength);
|
||||
data.title[data.titleLength] = '\0';
|
||||
char *title = new char[data.titleLength + 1];
|
||||
res->read(title, data.titleLength);
|
||||
title[data.titleLength] = '\0';
|
||||
data.title = Common::String(title);
|
||||
delete[] title;
|
||||
}
|
||||
if (data.type != kControlExitBox) {
|
||||
BorderBounds bbs = borderBounds(getWindowData(kCommandsWindow).type);
|
||||
|
Loading…
Reference in New Issue
Block a user