summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorRicardo Mestre <mestre@cvs.openbsd.org>2018-11-14 17:24:02 +0000
committerRicardo Mestre <mestre@cvs.openbsd.org>2018-11-14 17:24:02 +0000
commit3d3b57470d2ac1f0080c8d4bd3db283283dd8609 (patch)
tree454bd2c1f408a260e38632b2d55bcec012088204 /usr.sbin
parentec8e370acb55f8952f6b48e62b1bda4d0566d55e (diff)
Plug memory leak in host()'s error code path
OK claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bgpd/config.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c
index a8cb616790f..6cc77d2d1c6 100644
--- a/usr.sbin/bgpd/config.c
+++ b/usr.sbin/bgpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.77 2018/09/29 08:11:11 claudio Exp $ */
+/* $OpenBSD: config.c,v 1.78 2018/11/14 17:24:01 mestre Exp $ */
/*
* Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org>
@@ -340,6 +340,7 @@ host(const char *s, struct bgpd_addr *h, u_int8_t *len)
mask = strtonum(p+1, 0, 128, &errstr);
if (errstr) {
log_warnx("prefixlen is %s: %s", errstr, p);
+ free(ps);
return (0);
}
p[0] = '\0';