diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-10-19 17:42:22 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2019-10-19 17:42:22 +0000 |
commit | ac9a301cbcb87502a7a364713a46642b3223df08 (patch) | |
tree | bf6ad896efe94b747051eaa834d910bc96a462dd | |
parent | 553f9af9ca5d68dc9a8cae91a071cfc9a39989c5 (diff) |
Plug mem leak when the list of dhcp resolvers didn't change. ok florian@
-rw-r--r-- | sbin/unwind/resolver.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c index 4f69c99230b..6287cad7326 100644 --- a/sbin/unwind/resolver.c +++ b/sbin/unwind/resolver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resolver.c,v 1.45 2019/09/30 18:07:09 florian Exp $ */ +/* $OpenBSD: resolver.c,v 1.46 2019/10/19 17:42:21 otto Exp $ */ /* * Copyright (c) 2018 Florian Obser <florian@openbsd.org> @@ -744,8 +744,14 @@ parse_dhcp_forwarders(char *forwarders) new_forwarders(); if (resolver_conf->captive_portal_auto) check_captive_portal(1); - } else + } else { + while ((uw_forwarder = + SIMPLEQ_FIRST(&new_forwarder_list)) != NULL) { + SIMPLEQ_REMOVE_HEAD(&new_forwarder_list, entry); + free(uw_forwarder); + } log_debug("%s: forwarders didn't change", __func__); + } } void |