summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-01-31 05:56:20 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-01-31 05:56:20 +0000
commit72f3336e93742ddf13da6db0a5e6b2d48a52a813 (patch)
treed9158977e5d4e973cb81739b06397ed3aae6a671 /sbin/dhclient/dhclient.c
parentdd96249a769f06a670c3040d1169b46e5e5070c8 (diff)
Set is_static to 0 before trying to free a lease. Otherwise it
might leak. *Should* not be possible but better safe than sorry.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 3284c6e37f7..2a2b5e875c5 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.348 2015/01/30 14:30:54 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.349 2015/01/31 05:56:19 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2242,8 +2242,10 @@ apply_defaults(struct client_lease *lease)
return (newlease);
cleanup:
- if (newlease)
+ if (newlease) {
+ newlease->is_static = 0;
free_client_lease(newlease);
+ }
error("Unable to apply defaults");
/* NOTREACHED */