summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-11-02 17:00:53 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-11-02 17:00:53 +0000
commit26994c3e5e2a5108171859d50a0e0b74c3354bb0 (patch)
tree1a0a3cbbfa2c00d469eaa77e31fd620f28ade09e
parentc4a5135d55beb4e5f73d0ad313604b365d979984 (diff)
don't leak mem on strlcpy failure, Patrick Latifi
-rw-r--r--usr.sbin/bgpd/pftable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/pftable.c b/usr.sbin/bgpd/pftable.c
index a3101d2122b..95c9739ceae 100644
--- a/usr.sbin/bgpd/pftable.c
+++ b/usr.sbin/bgpd/pftable.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pftable.c,v 1.3 2004/09/14 23:08:44 henning Exp $ */
+/* $OpenBSD: pftable.c,v 1.4 2004/11/02 17:00:52 henning Exp $ */
/*
* Copyright (c) 2004 Damien Miller <djm@openbsd.org>
@@ -142,6 +142,7 @@ pftable_add(const char *name)
bzero(pft, sizeof(*pft));
if (strlcpy(pft->name, name, sizeof(pft->name)) >= sizeof(pft->name)) {
log_warn("pf_table name too long");
+ free(pft);
return (-1);
}