From a63482883e0e3487da4544699fa9c419cb17127d Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Fri, 15 Jul 2011 14:44:06 +0000 Subject: - Revert back to Z_Malloc from Hunk_FreeTempMemory introduced in r2077 as Hunk_FreeTempMemory must be freed in LIFO order (#5079) - Introduce SV_ClientFree() to prevent memory leaks r2077 was supposed to fix --- src/server/sv_init.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/server/sv_init.c') diff --git a/src/server/sv_init.c b/src/server/sv_init.c index d2e51d9f..4c0ae128 100644 --- a/src/server/sv_init.c +++ b/src/server/sv_init.c @@ -737,8 +737,14 @@ void SV_Shutdown( char *finalmsg ) { SV_ClearServer(); // free server static data - if ( svs.clients ) { - Z_Free( svs.clients ); + if(svs.clients) + { + int index; + + for(index = 0; index < sv_maxclients->integer; index++) + SV_FreeClient(&svs.clients[index]); + + Z_Free(svs.clients); } Com_Memset( &svs, 0, sizeof( svs ) ); -- cgit