From f30fc62dc47943a1ff73a3c4b77b12cdbc376e2d Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Wed, 15 Dec 2004 16:11:15 +0000 Subject: missing free()s; with pat --- sbin/pfctl/parse.y | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sbin/pfctl/parse.y') 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); } ; -- cgit v1.2.3