Command_Map_f, Command_QueueMap_f: Prevent memory leak on cheat-limited early-return

This commit is contained in:
toaster 2023-05-03 23:23:30 +01:00
parent b72bc73d28
commit 80ed8b81b9

View file

@ -2920,6 +2920,8 @@ static void Command_Map_f(void)
if (ischeating && !usingcheats)
{
CONS_Printf(M_GetText("Cheats must be enabled.\n"));
Z_Free(realmapname);
Z_Free(mapname);
return;
}
@ -3397,6 +3399,8 @@ static void Command_QueueMap_f(void)
if (ischeating && !usingcheats)
{
CONS_Printf(M_GetText("Cheats must be enabled.\n"));
Z_Free(realmapname);
Z_Free(mapname);
return;
}