certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/libCERTI SocketUDP.cc


From: certi-cvs
Subject: [certi-cvs] certi/libCERTI SocketUDP.cc
Date: Fri, 13 Jun 2008 10:54:24 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      08/06/13 10:54:24

Modified files:
        libCERTI       : SocketUDP.cc 

Log message:
        avoid C-style cast and fix memleak

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/libCERTI/SocketUDP.cc?cvsroot=certi&r1=3.20&r2=3.21

Patches:
Index: SocketUDP.cc
===================================================================
RCS file: /sources/certi/certi/libCERTI/SocketUDP.cc,v
retrieving revision 3.20
retrieving revision 3.21
diff -u -b -r3.20 -r3.21
--- SocketUDP.cc        12 Jun 2008 07:39:50 -0000      3.20
+++ SocketUDP.cc        13 Jun 2008 10:54:24 -0000      3.21
@@ -104,12 +104,12 @@
 assert(!_est_init_udp);
 
 // Building Local Address
-memset((struct sockaddr_in *) &sock_local, 0, sizeof(struct sockaddr_in));
-hp_local = (struct hostent *)malloc(sizeof(struct hostent));
+memset(&sock_local, 0, sizeof(struct sockaddr_in));
+hp_local = NULL;
 
 gethostname(localhost, 4096);
 
-if ((hp_local = (struct hostent *)gethostbyname(localhost)) == NULL)
+if ((hp_local = gethostbyname(localhost)) == NULL)
        {
                msg << "gethostbyname gave NULL answer for hostname <"
                        << localhost 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]