[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[certi-cvs] certi RTIG/RTIG_processing.cc libCERTI/SocketUD...
From: |
certi-cvs |
Subject: |
[certi-cvs] certi RTIG/RTIG_processing.cc libCERTI/SocketUD... |
Date: |
Tue, 29 Apr 2008 09:38:34 +0000 |
CVSROOT: /sources/certi
Module name: certi
Changes by: Eric NOULARD <erk> 08/04/29 09:38:33
Modified files:
RTIG : RTIG_processing.cc
libCERTI : SocketUDP.cc SocketUDP.hh
Log message:
memory leak--
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIG/RTIG_processing.cc?cvsroot=certi&r1=3.65&r2=3.66
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUDP.cc?cvsroot=certi&r1=3.18&r2=3.19
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUDP.hh?cvsroot=certi&r1=3.10&r2=3.11
Patches:
Index: RTIG/RTIG_processing.cc
===================================================================
RCS file: /sources/certi/certi/RTIG/RTIG_processing.cc,v
retrieving revision 3.65
retrieving revision 3.66
diff -u -b -r3.65 -r3.66
--- RTIG/RTIG_processing.cc 28 Apr 2008 15:35:57 -0000 3.65
+++ RTIG/RTIG_processing.cc 29 Apr 2008 09:38:33 -0000 3.66
@@ -18,7 +18,7 @@
// along with this program ; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// $Id: RTIG_processing.cc,v 3.65 2008/04/28 15:35:57 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.66 2008/04/29 09:38:33 erk Exp $
// ----------------------------------------------------------------------------
#include <config.h>
@@ -1394,4 +1394,4 @@
}} // namespace certi/rtig
-// $Id: RTIG_processing.cc,v 3.65 2008/04/28 15:35:57 rousse Exp $
+// $Id: RTIG_processing.cc,v 3.66 2008/04/29 09:38:33 erk Exp $
Index: libCERTI/SocketUDP.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUDP.cc,v
retrieving revision 3.18
retrieving revision 3.19
diff -u -b -r3.18 -r3.19
--- libCERTI/SocketUDP.cc 29 Apr 2008 08:33:05 -0000 3.18
+++ libCERTI/SocketUDP.cc 29 Apr 2008 09:38:33 -0000 3.19
@@ -91,6 +91,7 @@
struct sockaddr_in sock_temp ;
char localhost[4096] ;
std::stringstream msg;
+struct hostent * hp_local;
#ifdef _WIN32 //netDot
int taille = sizeof(struct sockaddr_in);
@@ -159,15 +160,15 @@
char localhost[MAXHOSTNAMELEN+1] ;
std::stringstream msg;
+ struct hostent * hp_local=NULL;
// Building Local Address
memset((struct sockaddr_in *) &sock_local, 0, sizeof(struct sockaddr_in));
- hp_local = (struct hostent *) malloc(sizeof(struct hostent));
gethostname(localhost, MAXHOSTNAMELEN);
hp_local = (struct hostent *) gethostbyname(localhost);
- if (hp_local == 0)
+ if (NULL == hp_local)
{
msg << "gethostbyname gave NULL answer for hostname <"
<< localhost
@@ -176,16 +177,9 @@
<< ">";
//perror("SocketUDP: gethostbyname");
throw NetworkError(msg.str().c_str());
-
}
-
-#ifdef _WIN32
memcpy((char *) &sock_local.sin_addr,(char *)hp_local->h_addr,
hp_local->h_length);
-#else
- bcopy((char *)hp_local->h_addr, (char *) &sock_local.sin_addr,
hp_local->h_length);
-#endif
-
sock_local.sin_family = hp_local->h_addrtype ;
sock_local.sin_port = htons((u_short)port);
@@ -210,7 +204,6 @@
_est_init_udp = false ;
hp_distant = NULL ;
-hp_local = NULL ;
PhysicalLink = true ;
BufferSize = 0 ;
Index: libCERTI/SocketUDP.hh
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUDP.hh,v
retrieving revision 3.10
retrieving revision 3.11
diff -u -b -r3.10 -r3.11
--- libCERTI/SocketUDP.hh 9 Dec 2007 16:46:50 -0000 3.10
+++ libCERTI/SocketUDP.hh 29 Apr 2008 09:38:33 -0000 3.11
@@ -104,8 +104,6 @@
unsigned long BufferSize ;
char Buffer[4096] ;
-
- struct hostent * hp_local ;
};
} // namespace certi
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [certi-cvs] certi RTIG/RTIG_processing.cc libCERTI/SocketUD...,
certi-cvs <=