mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
Fix #2550 Program crashes when executing "exit" command from the console
- exit and quit commands are aliased to "hide" - value of the command was being set to a constant value and could not be freed - updated command value to use a freeable value
This commit is contained in:
@@ -1045,8 +1045,10 @@ void console_execute_silent(const utf8 *src)
|
||||
return;
|
||||
|
||||
// Aliases for hiding the console
|
||||
if(strcmp(argv[0],"quit") == 0 || strcmp(argv[0],"exit") == 0)
|
||||
argv[0]="hide";
|
||||
if(strcmp(argv[0],"quit") == 0 || strcmp(argv[0],"exit") == 0) {
|
||||
free(argv[0]);
|
||||
argv[0] = _strdup("hide");
|
||||
}
|
||||
|
||||
bool validCommand = false;
|
||||
for (int i = 0; i < countof(console_command_table); i++) {
|
||||
|
||||
Reference in New Issue
Block a user