summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
committerLRN <lrn1986@gmail.com>2013-12-19 06:00:23 +0000
commite0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch)
treeecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/transport/plugin_transport_udp.c
parent92fd84dc7ef98452f848a62677c61a2b80b5835e (diff)
malloc -> new
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r--src/transport/plugin_transport_udp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 5b46c93c7..a5ee6494a 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -684,7 +684,7 @@ udp_string_to_address (void *cls, const char *addr, uint16_t addrlen,
{
struct IPv4UdpAddress *u4;
struct sockaddr_in *in4 = (struct sockaddr_in *) &socket_address;
- u4 = GNUNET_malloc (sizeof (struct IPv4UdpAddress));
+ u4 = GNUNET_new (struct IPv4UdpAddress);
u4->options = htonl (options);
u4->ipv4_addr = in4->sin_addr.s_addr;
u4->u4_port = in4->sin_port;
@@ -696,7 +696,7 @@ udp_string_to_address (void *cls, const char *addr, uint16_t addrlen,
{
struct IPv6UdpAddress *u6;
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *) &socket_address;
- u6 = GNUNET_malloc (sizeof (struct IPv6UdpAddress));
+ u6 = GNUNET_new (struct IPv6UdpAddress);
u6->options = htonl (options);
u6->ipv6_addr = in6->sin6_addr;
u6->u6_port = in6->sin6_port;
@@ -1911,7 +1911,7 @@ udp_plugin_send (void *cls,
if (s->frag_ctx != NULL)
return GNUNET_SYSERR;
memcpy (&udp[1], msgbuf, msgbuf_size);
- frag_ctx = GNUNET_malloc (sizeof (struct UDP_FragmentationContext));
+ frag_ctx = GNUNET_new (struct UDP_FragmentationContext);
frag_ctx->plugin = plugin;
frag_ctx->session = s;
frag_ctx->cont = cont;