Skip to content

Commit ff5beb7

Browse files
committed
[JO] Fix potential memory leak in screenshot code
byBlank can be allocated on autosave and it can still fail to read the levelshot image.
1 parent 93e2351 commit ff5beb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

code/server/sv_savegame.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,11 @@ static void SG_WriteScreenshot(qboolean qbAutosave, const char *psMapName)
10621062

10631063
if (!pbRawScreenShot)
10641064
{
1065+
if (byBlank != NULL)
1066+
{
1067+
delete[] byBlank;
1068+
}
1069+
10651070
const size_t bySize = SG_SCR_WIDTH * SG_SCR_HEIGHT * 3;
10661071

10671072
byBlank = new byte[bySize];

0 commit comments

Comments
 (0)