diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2003-05-03 16:50:39 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2003-05-03 16:50:39 +0000 |
commit | ca410e820b52cf536c5ca2ba9b9d172608a2287f (patch) | |
tree | ad36d02c4282ebe533dbfc66b4e4691643b60a2c /sbin/pfctl | |
parent | cef9b746a387a179b64221738338df6e5f432108 (diff) |
don't free() the char * carrying the rule label too early
noticed by Mathieu Sauve-Frankel <m.sauve at secureops.net> via silc
Diffstat (limited to 'sbin/pfctl')
-rw-r--r-- | sbin/pfctl/parse.y | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index 108999a0596..8e3ce470f2d 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.371 2003/05/01 16:22:12 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.372 2003/05/03 16:50:38 henning Exp $ */ /* * Copyright (c) 2001 Markus Friedl. All rights reserved. @@ -738,6 +738,7 @@ antispoof : ANTISPOOF logquick antispoof_ifspc af antispoof_opts { NULL, NULL, NULL, NULL, NULL, NULL); } } + free($5.label); } ; @@ -1217,7 +1218,7 @@ pfrule : action dir logquick interface route af proto fromto r.flagset = $9.flags.b2; if (rule_label(&r, $9.label)) YYERROR; - + free($9.label); if ($9.flags.b1 || $9.flags.b2) { for (proto = $7; proto != NULL && proto->proto != IPPROTO_TCP; @@ -4074,10 +4075,8 @@ rule_label(struct pf_rule *r, char *s) sizeof(r->label)) { yyerror("rule label too long (max %d chars)", sizeof(r->label)-1); - free(s); return (-1); } - free(s); } return (0); } |