summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2018-04-26 14:12:20 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2018-04-26 14:12:20 +0000
commitf936e0f3e9cc3e8d0c5e093bb0ef9ae2483d60a0 (patch)
treee4f4fba1bac608324e64cd44d66aa2503949b90e /sbin
parentd8d7c5e8de3ef6f6275cb2515b7088d50c1651d7 (diff)
Plug leak in error case of the common 'varset' implementations.
ok benno@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iked/parse.y4
-rw-r--r--sbin/ipsecctl/parse.y4
-rw-r--r--sbin/pfctl/parse.y4
3 files changed, 9 insertions, 3 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y
index 25446345a5a..2f507ff7bea 100644
--- a/sbin/iked/parse.y
+++ b/sbin/iked/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.70 2018/01/31 13:25:55 patrick Exp $ */
+/* $OpenBSD: parse.y,v 1.71 2018/04/26 14:12:19 krw Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -1074,6 +1074,8 @@ varset : STRING '=' string
if (isspace((unsigned char)*s)) {
yyerror("macro name cannot contain "
"whitespace");
+ free($1);
+ free($3);
YYERROR;
}
}
diff --git a/sbin/ipsecctl/parse.y b/sbin/ipsecctl/parse.y
index d5ba39ee185..d9739724d32 100644
--- a/sbin/ipsecctl/parse.y
+++ b/sbin/ipsecctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.169 2017/10/27 08:29:32 mpi Exp $ */
+/* $OpenBSD: parse.y,v 1.170 2018/04/26 14:12:19 krw Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -911,6 +911,8 @@ varset : STRING '=' string
if (isspace((unsigned char)*s)) {
yyerror("macro name cannot contain "
"whitespace");
+ free($1);
+ free($3);
YYERROR;
}
}
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index af2a9fedb4c..53b2337b468 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.670 2018/02/08 09:15:46 henning Exp $ */
+/* $OpenBSD: parse.y,v 1.671 2018/04/26 14:12:19 krw Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -788,6 +788,8 @@ varset : STRING '=' varstring {
if (isspace((unsigned char)*s)) {
yyerror("macro name cannot contain "
"whitespace");
+ free($1);
+ free($3);
YYERROR;
}
}