mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-01-23 21:24:27 +00:00
Fix possible memory leak.
This commit is contained in:
parent
c2064d88ed
commit
0324eb0431
@ -825,7 +825,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
char token[1024] = { 0 };
|
char token[1024] = { 0 };
|
||||||
float height;
|
float height;
|
||||||
|
|
||||||
char *pfile = NULL;
|
char *afile = NULL, *pfile = NULL;
|
||||||
|
|
||||||
memset( &m_OverviewData, 0, sizeof(m_OverviewData) );
|
memset( &m_OverviewData, 0, sizeof(m_OverviewData) );
|
||||||
|
|
||||||
@ -850,7 +850,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
|
|
||||||
sprintf( filename, "overviews/%s.txt", levelname );
|
sprintf( filename, "overviews/%s.txt", levelname );
|
||||||
|
|
||||||
pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL );
|
afile = pfile = (char *)gEngfuncs.COM_LoadFile( filename, 5, NULL );
|
||||||
|
|
||||||
if( !pfile )
|
if( !pfile )
|
||||||
{
|
{
|
||||||
@ -963,7 +963,7 @@ bool CHudSpectator::ParseOverviewFile()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gEngfuncs.COM_FreeFile( pfile );
|
gEngfuncs.COM_FreeFile( afile );
|
||||||
|
|
||||||
m_mapZoom = m_OverviewData.zoom;
|
m_mapZoom = m_OverviewData.zoom;
|
||||||
m_mapOrigin = m_OverviewData.origin;
|
m_mapOrigin = m_OverviewData.origin;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user