summaryrefslogtreecommitdiff
path: root/core/Lossless_UDP.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-08-19 07:15:56 -0400
committerirungentoo <irungentoo@gmail.com>2013-08-19 07:15:56 -0400
commit17890b1f61da9b0e8ea94ccfe32a9d0f6ebf3111 (patch)
tree4820965c7889de2c6728aa4b69806426afcf1a70 /core/Lossless_UDP.c
parent88986f793a02921e8a23e540a80275e91c87a82a (diff)
Realloc apparently doesn't always behave like free() if size is zero.
Diffstat (limited to 'core/Lossless_UDP.c')
-rw-r--r--core/Lossless_UDP.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c
index fa5f9144..2210f7d3 100644
--- a/core/Lossless_UDP.c
+++ b/core/Lossless_UDP.c
@@ -319,6 +319,12 @@ static void free_connections(void)
319 if (connections_length == i) 319 if (connections_length == i)
320 return; 320 return;
321 321
322 if (i == 0) {
323 free(connections);
324 connections = NULL;
325 return;
326 }
327
322 Connection *temp; 328 Connection *temp;
323 temp = realloc(connections, sizeof(Connection) * i); 329 temp = realloc(connections, sizeof(Connection) * i);
324 330