diff options
author | 2009-11-12 19:46:31 +0000 | |
---|---|---|
committer | 2009-11-12 19:46:31 +0000 | |
commit | e957c160f25cfac164a4e207cb6543808960d191 (patch) | |
tree | 741e516980d23d0058bb35dd36b12708cd79ad4b | |
parent | typo (diff) | |
download | wireguard-openbsd-e957c160f25cfac164a4e207cb6543808960d191.tar.xz wireguard-openbsd-e957c160f25cfac164a4e207cb6543808960d191.zip |
memory leak if regex fails, found by parfait; ok miod
-rw-r--r-- | bin/systrace/parse.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/systrace/parse.y b/bin/systrace/parse.y index f5eddac913f..9420ec4301b 100644 --- a/bin/systrace/parse.y +++ b/bin/systrace/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.16 2006/03/18 19:03:23 robert Exp $ */ +/* $OpenBSD: parse.y,v 1.17 2009/11/12 19:46:31 deraadt Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> @@ -411,11 +411,14 @@ symbol : STRING typeoff MATCH CMDSTRING REG_EXTENDED | REG_NOSUB) != 0) { yyerror("Invalid regular expression: %s", node->filterdata); + free(re); break; } node->filterarg = re; - } else + } else { + free(re); node->filterarg = NULL; + } node->filter_match = filter_regex; $$ = node; |