diff options
author | 2015-02-06 04:18:20 +0000 | |
---|---|---|
committer | 2015-02-06 04:18:20 +0000 | |
commit | 7abba1632535511f0fa340b28b0b4f2f8a8ba0c5 (patch) | |
tree | 99b586fff912c1ff2668ac80bef6afd5d7df0b42 | |
parent | better handle .Fo and .Fd without argument (diff) | |
download | wireguard-openbsd-7abba1632535511f0fa340b28b0b4f2f8a8ba0c5.tar.xz wireguard-openbsd-7abba1632535511f0fa340b28b0b4f2f8a8ba0c5.zip |
Don't let errors leak the memory returned by getifaddrs().
-rw-r--r-- | sbin/dhclient/dispatch.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 0544b18c02d..2a4aff340d5 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.99 2014/12/10 02:34:03 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.100 2015/02/06 04:18:20 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -391,18 +391,22 @@ subnet_exists(struct client_lease *l) if (mynet.s_addr == (hisaddr.s_addr & mymask.s_addr)) { note("interface %s already has the offered subnet!", ifa->ifa_name); - return (1); + break; } /* Would my packets go out *his* interface? */ if (hisnet.s_addr == (myaddr.s_addr & hismask.s_addr)) { note("interface %s already has the offered subnet!", ifa->ifa_name); - return (1); + break; } } freeifaddrs(ifap); - return (0); + /* If ifa == NULL we scanned the list without finding a problem. */ + if (ifa == NULL) + return (0); + else + return (1); } |