From: claudio Date: Thu, 2 Aug 2018 12:46:02 +0000 (+0000) Subject: Make free_prefixsets() accept a NULL pointer. Makes it behave more like X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1d146b530532094d95d33179b9643e4d60201dcc;p=openbsd Make free_prefixsets() accept a NULL pointer. Makes it behave more like all other free functions bgpd has. --- diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index cdb65308a36..dcb47b64894 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.69 2018/07/11 21:10:07 benno Exp $ */ +/* $OpenBSD: config.c,v 1.70 2018/08/02 12:46:02 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -119,6 +119,8 @@ free_prefixsets(struct prefixset_head *psh) struct prefixset *ps; struct prefixset_item *psi; + if (psh == NULL) + return; while (!SIMPLEQ_EMPTY(psh)) { ps = SIMPLEQ_FIRST(psh); diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 96a137729df..17225b73d9b 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.404 2018/08/02 09:46:35 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.405 2018/08/02 12:46:02 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2831,8 +2831,7 @@ rde_reload_done(void) ribs[rid].state = RECONF_NONE; } - if (prefixsets_old != NULL) - free_prefixsets(prefixsets_old); + free_prefixsets(prefixsets_old); prefixsets_old = NULL; log_info("RDE reconfigured");