summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 19:46:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-11-12 19:46:32 +0000
commitd89cd653b47b9a8da67bfa4eecab3f0dd93fd671 (patch)
tree8c19a3e2daec2bffab8d1f3ffc0908c42e1014f7 /bin
parentd1f9f010ab1aaa3c043c907e63709b1222b2364e (diff)
memory leak if regex fails, found by parfait; ok miod
Diffstat (limited to 'bin')
-rw-r--r--bin/systrace/parse.y7
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;