Balance a getifaddrs() with a freeifaddrs(); plugs a leak seen by
authorotto <otto@openbsd.org>
Sun, 11 Dec 2022 10:47:37 +0000 (10:47 +0000)
committerotto <otto@openbsd.org>
Sun, 11 Dec 2022 10:47:37 +0000 (10:47 +0000)
florian@ and myself.  ok florian@

sbin/dhcpleased/dhcpleased.c

index cc9d989..dc52c6d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhcpleased.c,v 1.27 2022/11/27 15:19:38 kn Exp $      */
+/*     $OpenBSD: dhcpleased.c,v 1.28 2022/12/11 10:47:37 otto Exp $    */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -805,6 +805,7 @@ configure_interface(struct imsg_configure_interface *imsg)
                        break;
                }
        }
+       freeifaddrs(ifap);
 
        req_sin_addr->sin_addr = imsg->addr;
        if (!found) {