From: florian Date: Sun, 2 Jun 2024 15:19:05 +0000 (+0000) Subject: fix leaks X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c266488b9f1ef511742a8b5ad7456a1e656ce3bd;p=openbsd fix leaks --- diff --git a/sbin/dhcp6leased/dhcp6leased.c b/sbin/dhcp6leased/dhcp6leased.c index 1884fb6516c..e0943338425 100644 --- a/sbin/dhcp6leased/dhcp6leased.c +++ b/sbin/dhcp6leased/dhcp6leased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp6leased.c,v 1.2 2024/06/02 13:35:52 florian Exp $ */ +/* $OpenBSD: dhcp6leased.c,v 1.3 2024/06/02 15:19:05 florian Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -796,6 +796,8 @@ open_udpsock(uint32_t if_index) } } + freeifaddrs(ifap); + sin6->sin6_port = htons(CLIENT_PORT); log_debug("%s: %s rdomain: %d", __func__, sin6_to_str(sin6), rdomain); diff --git a/sbin/dhcp6leased/frontend.c b/sbin/dhcp6leased/frontend.c index 7db0d50e09a..d50c606463b 100644 --- a/sbin/dhcp6leased/frontend.c +++ b/sbin/dhcp6leased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.5 2024/06/02 14:07:19 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.6 2024/06/02 15:19:05 florian Exp $ */ /* * Copyright (c) 2017, 2021, 2024 Florian Obser @@ -572,7 +572,7 @@ update_iface(uint32_t if_index) } } out: - + freeifaddrs(ifap); iface = get_iface_by_id(if_index); if (iface == NULL) { if ((iface = calloc(1, sizeof(*iface))) == NULL)