summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2006-01-08 03:36:40 +0000
committerSimon Howard2006-01-08 03:36:40 +0000
commit0a55e76dc58993267abb4b0cde944f1babecc242 (patch)
tree5a0c93563dc6f536d819c69a89554d1322dd3a11 /src
parent8fdfe2014d1be3eb855afc55107df64a1cd784f8 (diff)
downloadchocolate-doom-0a55e76dc58993267abb4b0cde944f1babecc242.tar.gz
chocolate-doom-0a55e76dc58993267abb4b0cde944f1babecc242.tar.bz2
chocolate-doom-0a55e76dc58993267abb4b0cde944f1babecc242.zip
Fix double free of addresses
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 267
Diffstat (limited to 'src')
-rw-r--r--src/net_client.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/net_client.c b/src/net_client.c
index b1232869..b2fef28a 100644
--- a/src/net_client.c
+++ b/src/net_client.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_client.c 265 2006-01-08 02:53:31Z fraggle $
+// $Id: net_client.c 267 2006-01-08 03:36:40Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.12 2006/01/08 03:36:40 fraggle
+// Fix double free of addresses
+//
// Revision 1.11 2006/01/08 02:53:31 fraggle
// Detect when client connection is disconnected.
//
@@ -119,11 +122,14 @@ boolean net_waiting_for_start = false;
static void NET_CL_Shutdown(void)
{
- net_client_connected = false;
+ if (net_client_connected)
+ {
+ net_client_connected = false;
- NET_FreeAddress(server_addr);
+ NET_FreeAddress(server_addr);
- // Shut down network module, etc. To do.
+ // Shut down network module, etc. To do.
+ }
}
// data received while we are waiting for the game to start
@@ -232,6 +238,10 @@ void NET_CL_Run(void)
{
NET_CL_ParsePacket(packet);
}
+ else
+ {
+ NET_FreeAddress(addr);
+ }
NET_FreePacket(packet);
}