engine: server: fix memleak after previous commit

This commit is contained in:
Alibek Omarov 2021-06-02 22:06:17 +03:00
parent 8966172ce0
commit 49a20a9ac5
1 changed files with 8 additions and 0 deletions

View File

@ -4787,7 +4787,15 @@ qboolean SV_ParseEdict( char **pfile, edict_t *ent )
}
if( classname == NULL )
{
// release allocated strings
for( i = 0; i < numpairs; i++ )
{
Mem_Free( pkvd[i].szKeyName );
Mem_Free( pkvd[i].szValue );
}
return false;
}
ent = SV_AllocPrivateData( ent, ALLOC_STRING( classname ));