Merge pull request #22 from noshbar/L1

Fix potential memory leak in win32/console.c
This commit is contained in:
manojampalam 2015-11-05 12:26:22 -08:00
commit 9fa44f0777

View File

@ -1627,7 +1627,13 @@ SCREEN_HANDLE ConSaveScreenHandle( SCREEN_HANDLE hScreen )
}
if ( !pScreenRec->pScreenBuf )
{
// if we allocated a screen within this scope, free it before returning
if ( pScreenRec != (PSCREEN_RECORD)hScreen ) {
free(pScreenRec);
}
return NULL;
}
result = ReadConsoleOutput( hConsole, // handle of a console screen buffer
(PCHAR_INFO)(pScreenRec->pScreenBuf), // address of buffer that receives data