summaryrefslogtreecommitdiff
path: root/src/sv_init.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2011-04-27 13:42:49 +0400
committerAndrey Nazarov <skuller@skuller.net>2011-04-27 13:42:49 +0400
commitae56d347700899841c851e651b00bea0dc4427ed (patch)
tree62c46cd45be3d87eeca42b2c5f9a3bc7e31885d6 /src/sv_init.c
parent776fa0343672058a66f2ed994e67cfa610189a57 (diff)
Fix possible server memory leak.
Rework server shutdown procedure to make it safe to be run even if server is not fully initalized yet. This fixes a possible memory leak when ERR_DROP is thrown on initialization (due to missing game library, for example).
Diffstat (limited to 'src/sv_init.c')
-rw-r--r--src/sv_init.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sv_init.c b/src/sv_init.c
index a6f7ec8..6d443a1 100644
--- a/src/sv_init.c
+++ b/src/sv_init.c
@@ -273,6 +273,7 @@ void SV_InitGame( qboolean ismvd ) {
#endif
CM_FreeMap( &sv.cm );
+ SV_FreeFile( sv.entitystring );
memset( &sv, 0, sizeof( sv ) );
}
@@ -360,8 +361,6 @@ void SV_InitGame( qboolean ismvd ) {
// send heartbeat very soon
svs.last_heartbeat = -(HEARTBEAT_SECONDS-5)*1000;
- List_Init( &svs.client_list );
-
for( i = 0; i < sv_maxclients->integer; i++ ) {
client = svs.client_pool + i;
entnum = i + 1;