diff options
author | fcolin | 2005-08-18 07:36:18 +0000 |
---|---|---|
committer | fcolin | 2005-08-18 07:36:18 +0000 |
commit | 9921017a4b14b379d99305e17f8583ff90de0c1b (patch) | |
tree | 2f76b0a528a766ee67be1ba82973f02acc6e85c2 /src/ivysocket.c | |
parent | f625f6e00c1d5d1194ce3db62e59ccc47fdf2386 (diff) | |
download | ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.zip ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.gz ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.bz2 ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.xz |
memory leak malloc/free cleanup
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r-- | src/ivysocket.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/ivysocket.c b/src/ivysocket.c index 9fac44c..d2f3259 100644 --- a/src/ivysocket.c +++ b/src/ivysocket.c @@ -14,16 +14,15 @@ * copyright notice regarding this software */ -#ifdef WIN32 -#include <windows.h> -#endif + #include <stdlib.h> #include <errno.h> #include <stdio.h> #include <stdarg.h> #include <string.h> - #ifdef WIN32 +#include <crtdbg.h> +#include <windows.h> #define close closesocket /*#define perror (a ) printf(a" error=%d\n",WSAGetLastError());*/ #else @@ -87,6 +86,8 @@ static void DeleteSocket(void *data) (*client->handle_delete) (client, client->data ); shutdown (client->fd, 2 ); close (client->fd ); + free( client->in_buffer ); + free( client->out_buffer ); IVY_LIST_REMOVE (clients_list, client ); } @@ -95,7 +96,7 @@ static void DeleteServerSocket(void *data) Server server = (Server )data; #ifdef BUGGY_END if (server->handle_delete ) - (*server->handle_delete) (server, NULL ); + (*server->handle_delete) (server->channel, NULL ); #endif shutdown (server->fd, 2 ); close (server->fd ); @@ -301,7 +302,7 @@ void SocketServerClose (Server server ) { if (!server) return; - IvyChannelRemove (server->channel ); + IvyChannelRemove( server->channel ); } char *SocketGetPeerHost (Client client ) |