summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpctl
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpctl')
-rw-r--r--usr.sbin/bgpctl/parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/bgpctl/parser.c b/usr.sbin/bgpctl/parser.c
index 3ee603c0ad1..3bb988847be 100644
--- a/usr.sbin/bgpctl/parser.c
+++ b/usr.sbin/bgpctl/parser.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parser.c,v 1.49 2008/06/11 03:19:39 tobias Exp $ */
+/* $OpenBSD: parser.c,v 1.50 2008/06/15 09:58:43 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -633,8 +633,10 @@ parse_prefix(const char *word, struct bgpd_addr *addr, u_int8_t *prefixlen)
err(1, "parse_prefix: malloc");
strlcpy(ps, word, strlen(word) - strlen(p) + 1);
- if (parse_addr(ps, addr) == 0)
+ if (parse_addr(ps, addr) == 0) {
+ free(ps);
return (0);
+ }
free(ps);
} else