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));

Reply via email to