- fix error messages
[oweals/gnunet.git] / src / transport / transport_api_address_to_string.c
index 152e573cd78e17038f8e9aa6ce37ecd0591dacd4..0cf0111b3bd44bca0877fdb71f32b03da4d7748b 100644 (file)
      Boston, MA 02111-1307, USA.
 */
 #include "platform.h"
-#include "gnunet_client_lib.h"
+#include "gnunet_util_lib.h"
 #include "gnunet_arm_service.h"
 #include "gnunet_hello_lib.h"
 #include "gnunet_protocols.h"
-#include "gnunet_server_lib.h"
-#include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
 #include "transport.h"
 
@@ -154,7 +152,7 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle
   memcpy (addrbuf, address->address, alen);
   memcpy (&addrbuf[alen], address->transport_name, slen);
 
-  alc = GNUNET_malloc (sizeof (struct GNUNET_TRANSPORT_AddressToStringContext));
+  alc = GNUNET_new (struct GNUNET_TRANSPORT_AddressToStringContext);
   alc->cb = aluc;
   alc->cb_cls = aluc_cls;
   alc->timeout = GNUNET_TIME_relative_to_absolute (timeout);
@@ -172,15 +170,15 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle
 /**
  * Cancel request for address conversion.
  *
- * @param alc handle for the request to cancel
+ * @param pic the context handle
  */
 void
 GNUNET_TRANSPORT_address_to_string_cancel (struct
                                            GNUNET_TRANSPORT_AddressToStringContext
-                                           *alc)
+                                           *pic)
 {
-  GNUNET_CLIENT_disconnect (alc->client);
-  GNUNET_free (alc);
+  GNUNET_CLIENT_disconnect (pic->client);
+  GNUNET_free (pic);
 }