summaryrefslogtreecommitdiffhomepage
path: root/src/router.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-10-15 10:54:15 +0200
committerSteven Barth <steven@midlink.org>2013-10-15 10:54:15 +0200
commit7117854698ba7c77da5823fc673f44e6db0fee5f (patch)
treef9e59dc196eac4441ff031c873a1e84bbe9a771b /src/router.c
parentb9ffc26a2d12b9769d1c519d8c851b7c9301e82c (diff)
Fix some more memory issues
Diffstat (limited to 'src/router.c')
-rw-r--r--src/router.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/router.c b/src/router.c
index 9258acf..bb7ddcd 100644
--- a/src/router.c
+++ b/src/router.c
@@ -352,7 +352,7 @@ static void send_router_advert(struct uloop_timeout *event)
uint8_t pad2;
uint32_t lifetime;
uint8_t name[];
- } *search = alloca(sizeof(*search) + search_padded);
+ } *search = malloc(sizeof(*search) + search_padded);
search->type = ND_OPT_DNS_SEARCH;
search->len = search_len ? ((sizeof(*search) + search_padded) / 8) : 0;
search->pad = 0;
@@ -409,6 +409,7 @@ static void send_router_advert(struct uloop_timeout *event)
struct sockaddr_in6 all_nodes = {AF_INET6, 0, 0, ALL_IPV6_NODES, 0};
odhcpd_send(router_event.uloop.fd,
&all_nodes, iov, ARRAY_SIZE(iov), iface);
+ free(search);
// Rearm timer
int msecs;