]> sjero.net Git - wget/blobdiff - src/connect.c
Use Gnulib's alloc functions in connect.c.
[wget] / src / connect.c
index 2be764d41c2356f0302eafd41fadd8153c386ceb..d8e20368be0ff56e107f7e28219383253fa5dcad 100644 (file)
@@ -28,6 +28,8 @@ Corresponding Source for a non-source form of such a combination
 shall include the source code for the parts of OpenSSL used as well
 as that of the covered work.  */
 
+#define USE_GNULIB_ALLOC
+
 #include "wget.h"
 
 #include <stdio.h>
@@ -195,8 +197,8 @@ resolve_bind_address (struct sockaddr *sa)
     {
       /* #### We should be able to print the error message here. */
       logprintf (LOG_NOTQUIET,
-                 _("%s: unable to resolve bind address `%s'; disabling bind.\n"),
-                 exec_name, opt.bind_address);
+                 _("%s: unable to resolve bind address %s; disabling bind.\n"),
+                 exec_name, quote (opt.bind_address));
       should_bind = false;
       return false;
     }
@@ -366,8 +368,8 @@ connect_to_host (const char *host, int port)
   if (!al)
     {
       logprintf (LOG_NOTQUIET,
-                 _("%s: unable to resolve host address `%s'\n"),
-                 exec_name, host);
+                 _("%s: unable to resolve host address %s\n"),
+                 exec_name, quote (host));
       return E_HOST;
     }
 
@@ -766,7 +768,7 @@ fd_register_transport (int fd, struct transport_implementation *imp, void *ctx)
      hash key.  */
   assert (fd >= 0);
 
-  info = xnew (struct transport_info);
+  info = xmalloc (sizeof (struct transport_info));
   info->imp = imp;
   info->ctx = ctx;
   if (!transport_map)
@@ -958,7 +960,7 @@ fd_close (int fd)
   if (info)
     {
       hash_table_remove (transport_map, (void *)(intptr_t) fd);
-      xfree (info);
+      free (info);
       ++transport_map_modified_tick;
     }
 }