From 49a20a9ac59ecf13433f2687756585b97ef55236 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 2 Jun 2021 22:06:17 +0300 Subject: [PATCH] engine: server: fix memleak after previous commit --- engine/server/sv_game.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/server/sv_game.c b/engine/server/sv_game.c index 184e42df..bccac6f5 100644 --- a/engine/server/sv_game.c +++ b/engine/server/sv_game.c @@ -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 ));