From: miod Date: Mon, 14 Jul 2014 18:16:27 +0000 (+0000) Subject: Make sure to correctly exit the loop in priv_flush_routes() in case of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a80184b40994aaae9cd0244a6afe92209104b8ed;p=openbsd Make sure to correctly exit the loop in priv_flush_routes() in case of allocation failure; ok krw@ --- 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);