summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-01-30 14:30:55 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-01-30 14:30:55 +0000
commitbb3cad44385e22b29e98da59190363a8df5e6725 (patch)
tree083f7a37d60e8cea1446049e0d96123f7be588f1 /sbin
parent0b6f6e37fb4471fc1451b41badc1583034c67806 (diff)
Don't leak incompletely cloned static lease. Should never happen
but better safe than sorry. Noted and diff from Benjamin Baier. Thanks!
Diffstat (limited to 'sbin')
-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 08a188a4703..3284c6e37f7 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.347 2015/01/16 06:39:56 deraadt Exp $ */
+/* $OpenBSD: dhclient.c,v 1.348 2015/01/30 14:30:54 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -2297,8 +2297,10 @@ clone_lease(struct client_lease *oldlease)
return (newlease);
cleanup:
- if (newlease)
+ if (newlease) {
+ newlease->is_static = 0;
free_client_lease(newlease);
+ }
return (NULL);
}