develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33879 - trunk/src/io

From:
cotto
Date:
December 14, 2008 03:33
Subject:
[svn:parrot] r33879 - trunk/src/io
Message ID:
20081214113324.49187CBAC8@x12.develooper.com
Author: cotto
Date: Sun Dec 14 03:33:22 2008
New Revision: 33879

Modified:
   trunk/src/io/socket_unix.c

Log:
[io] free string after using it, rather than before (CID #343)


Modified: trunk/src/io/socket_unix.c
==============================================================================
--- trunk/src/io/socket_unix.c	(original)
+++ trunk/src/io/socket_unix.c	Sun Dec 14 03:33:22 2008
@@ -98,8 +98,8 @@
         struct hostent *he = gethostbyname(s);
         /* XXX FIXME - Handle error condition better */
         if (!he) {
-            string_cstring_free(s);
             fprintf(stderr, "gethostbyname failure [%s]\n", s);
+            string_cstring_free(s);
             return NULL;
         }
         memcpy((char*)&sa.sin_addr, he->h_addr, sizeof (sa.sin_addr));



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About