From 8ebf7e3d5a9161894cf99a5a38e59df2d7118a29 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 12:53:56 +0000 Subject: Utilisateur : Fcolin Date : 19/04/06 Heure : 15:07 Archivé dans $/Bus/Ivy Commentaire: (vss 19) --- Bus/Ivy/BufferedSocket.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Bus/Ivy') diff --git a/Bus/Ivy/BufferedSocket.cxx b/Bus/Ivy/BufferedSocket.cxx index 3335e09..1a11c56 100644 --- a/Bus/Ivy/BufferedSocket.cxx +++ b/Bus/Ivy/BufferedSocket.cxx @@ -36,6 +36,7 @@ void CBufferedSocket::OnReceive(int nErrorCode) char *ptr; size_t nb_to_read = 0; size_t nb; + char *tmp_buf; SOCKADDR addr; size_t len = sizeof( addr ); @@ -45,12 +46,13 @@ void CBufferedSocket::OnReceive(int nErrorCode) if( nb_to_read == 0 ) { buffer_size *= 2; /* twice old size */ - buffer = (char*)realloc( buffer, buffer_size ); - if (!buffer ) + tmp_buf = (char*)realloc( buffer, buffer_size ); + if (!tmp_buf ) { TRACE("HandleSocket Buffer Memory Alloc Error\n"); exit(0); } + buffer = tmp_buf; TRACE( "Buffer Limit reached realloc new size %ld\n", buffer_size ); nb_to_read = buffer_size - (current_ptr - buffer ); } -- cgit v1.1