summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-12-15 16:11:15 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-12-15 16:11:15 +0000
commitf30fc62dc47943a1ff73a3c4b77b12cdbc376e2d (patch)
tree77104eb84e9cc24767db8c05ab844fccee8c302f /sbin/pfctl
parentd27d748842eb80b51a4b4141ce6808efe4bdaa06 (diff)
missing free()s; with pat
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/parse.y9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index ddce9fa4012..65a4de7bac7 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.469 2004/12/10 22:13:26 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.470 2004/12/15 16:11:14 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -2257,18 +2257,23 @@ host : STRING {
}
| ROUTE STRING {
$$ = calloc(1, sizeof(struct node_host));
- if ($$ == NULL)
+ if ($$ == NULL) {
+ free($2);
err(1, "host: calloc");
+ }
$$->addr.type = PF_ADDR_RTLABEL;
if (strlcpy($$->addr.v.rtlabelname, $2,
sizeof($$->addr.v.rtlabelname)) >=
sizeof($$->addr.v.rtlabelname)) {
yyerror("route label too long, max %u chars",
sizeof($$->addr.v.rtlabelname) - 1);
+ free($2);
+ free($$);
YYERROR;
}
$$->next = NULL;
$$->tail = $$;
+ free($2);
}
;