summaryrefslogtreecommitdiff
path: root/src/net_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_client.c')
-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);
}