mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-05-03 22:40:34 +02:00
Merge pull request #22 from noshbar/L1
Fix potential memory leak in win32/console.c
This commit is contained in:
commit
9fa44f0777
@ -1627,7 +1627,13 @@ SCREEN_HANDLE ConSaveScreenHandle( SCREEN_HANDLE hScreen )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !pScreenRec->pScreenBuf )
|
if ( !pScreenRec->pScreenBuf )
|
||||||
|
{
|
||||||
|
// if we allocated a screen within this scope, free it before returning
|
||||||
|
if ( pScreenRec != (PSCREEN_RECORD)hScreen ) {
|
||||||
|
free(pScreenRec);
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
result = ReadConsoleOutput( hConsole, // handle of a console screen buffer
|
result = ReadConsoleOutput( hConsole, // handle of a console screen buffer
|
||||||
(PCHAR_INFO)(pScreenRec->pScreenBuf), // address of buffer that receives data
|
(PCHAR_INFO)(pScreenRec->pScreenBuf), // address of buffer that receives data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user