diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-04-17 16:41:22 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-04-17 16:41:22 +0000 |
commit | f5453f74be5b3ed613831fb982e14d3df97bf084 (patch) | |
tree | cacbe677b0dbf4719f67a150f7ced5c19e250d93 /usr.sbin | |
parent | ae00f72e6779794de9a4dbdb6e213236f334a872 (diff) |
and don't try to free a null set either
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bgpd/parse.y | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 8b5b8224155..dff6c9ae9a7 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.160 2005/04/17 16:36:40 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.161 2005/04/17 16:41:21 henning Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2105,11 +2105,13 @@ expand_rule(struct filter_rule *rule, struct filter_peers_l *peer, free(a); } - while (set != NULL && (s = SIMPLEQ_FIRST(set)) != NULL) { - SIMPLEQ_REMOVE_HEAD(set, entry); - free(s); + if (set != NULL) { + while ((s = SIMPLEQ_FIRST(set)) != NULL) { + SIMPLEQ_REMOVE_HEAD(set, entry); + free(s); + } + free(set); } - free(set); return (0); } |