From a80184b40994aaae9cd0244a6afe92209104b8ed Mon Sep 17 00:00:00 2001 From: miod Date: Mon, 14 Jul 2014 18:16:27 +0000 Subject: [PATCH] Make sure to correctly exit the loop in priv_flush_routes() in case of allocation failure; ok krw@ --- sbin/dhclient/kroute.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/dhclient/kroute.c b/sbin/dhclient/kroute.c index 4c48bc5b51d..a5b040839af 100644 --- a/sbin/dhclient/kroute.c +++ b/sbin/dhclient/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.66 2014/07/09 15:16:38 krw Exp $ */ +/* $OpenBSD: kroute.c,v 1.67 2014/07/14 18:16:27 miod Exp $ */ /* * Copyright 2012 Kenneth R Westerback @@ -101,7 +101,7 @@ priv_flush_routes(struct imsg_flush_routes *imsg) if ((bufp = realloc(buf, needed)) == NULL) { free(buf); errmsg = "routes buf malloc:"; - continue; + break; } buf = bufp; if (sysctl(mib, 7, buf, &needed, NULL, 0) == -1) { @@ -138,7 +138,7 @@ priv_flush_routes(struct imsg_flush_routes *imsg) case ROUTE_LABEL_DHCLIENT_OURS: /* Always delete routes we labeled. */ delete_route(s, imsg->rdomain, rtm); - break;; + break; case ROUTE_LABEL_DHCLIENT_DEAD: if (imsg->zapzombies) delete_route(s, imsg->rdomain, rtm); -- 2.20.1