Free (GPLv2) TCP/IP stack developed by TASS Belgium

Fork of PicoTCP by Daniele Lacamera

Files at this revision

API Documentation at this revision

Comitter:
daniele
Date:
Sun Jun 16 20:27:04 2013 +0000
Parent:
29:1a47b7151851
Child:
32:865c101e0874
Commit message:
fixed return address in accept()

Changed in this revision

Socket/TCPSocketServer.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Socket/TCPSocketServer.cpp	Sun Jun 16 20:19:44 2013 +0000
+++ b/Socket/TCPSocketServer.cpp	Sun Jun 16 20:27:04 2013 +0000
@@ -70,7 +70,7 @@
 }
 
 int TCPSocketServer::accept(TCPSocketConnection& connection) {
-    char *address;
+    char address[80];
     if (_ep < 0)
         return -1;
     
@@ -88,7 +88,6 @@
     }
     connection.set_blocking(true,1500);
     connection._is_connected = true;
-    address = (char *)malloc(80);
     pico_ipv4_to_string(address, connection._remoteHost.sin_addr.s_addr);
     connection.set_address(address, connection._remoteHost.sin_port);
     return 0;