Browse Source

Fix possible memory leak.

hl_urbicide
Andrey Akhmichin 4 years ago
parent
commit
0324eb0431
  1. 6
      cl_dll/hud_spectator.cpp

6
cl_dll/hud_spectator.cpp

@ -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…
Cancel
Save