diff options
author | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-12-19 06:00:23 +0000 |
commit | e0ca7357cd0bfedc5c29cb731b56279fef8da059 (patch) | |
tree | ecfd47cf59bc00e656b53fd59c58f5038e342d65 /src/nat | |
parent | 92fd84dc7ef98452f848a62677c61a2b80b5835e (diff) | |
download | gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.tar.gz gnunet-e0ca7357cd0bfedc5c29cb731b56279fef8da059.zip |
malloc -> new
Diffstat (limited to 'src/nat')
-rw-r--r-- | src/nat/gnunet-nat-server.c | 2 | ||||
-rw-r--r-- | src/nat/nat_mini.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c index 1a98cdc96..82e39ee16 100644 --- a/src/nat/gnunet-nat-server.c +++ b/src/nat/gnunet-nat-server.c | |||
@@ -152,7 +152,7 @@ try_send_tcp (uint32_t dst_ipv4, uint16_t dport, uint16_t data) | |||
152 | GNUNET_NETWORK_socket_close (s); | 152 | GNUNET_NETWORK_socket_close (s); |
153 | return; | 153 | return; |
154 | } | 154 | } |
155 | ctx = GNUNET_malloc (sizeof (struct TcpContext)); | 155 | ctx = GNUNET_new (struct TcpContext); |
156 | ctx->s = s; | 156 | ctx->s = s; |
157 | ctx->data = data; | 157 | ctx->data = data; |
158 | GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_SECONDS, s, &tcp_send, ctx); | 158 | GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_SECONDS, s, &tcp_send, ctx); |
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index dd1aede5e..497371e86 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c | |||
@@ -172,7 +172,7 @@ GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, | |||
172 | } | 172 | } |
173 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 173 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
174 | "Running `external-ip' to determine our external IP\n"); | 174 | "Running `external-ip' to determine our external IP\n"); |
175 | eh = GNUNET_malloc (sizeof (struct GNUNET_NAT_ExternalHandle)); | 175 | eh = GNUNET_new (struct GNUNET_NAT_ExternalHandle); |
176 | eh->cb = cb; | 176 | eh->cb = cb; |
177 | eh->cb_cls = cb_cls; | 177 | eh->cb_cls = cb_cls; |
178 | eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); | 178 | eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); |
@@ -507,7 +507,7 @@ GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, | |||
507 | } | 507 | } |
508 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 508 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
509 | "Running `upnpc' to install mapping\n"); | 509 | "Running `upnpc' to install mapping\n"); |
510 | ret = GNUNET_malloc (sizeof (struct GNUNET_NAT_MiniHandle)); | 510 | ret = GNUNET_new (struct GNUNET_NAT_MiniHandle); |
511 | ret->ac = ac; | 511 | ret->ac = ac; |
512 | ret->ac_cls = ac_cls; | 512 | ret->ac_cls = ac_cls; |
513 | ret->is_tcp = is_tcp; | 513 | ret->is_tcp = is_tcp; |