summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2019-10-18 06:03:26 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2019-10-18 06:03:26 +0000
commitb45a609831b2b6685f893a3a819464a2a1fd9e3b (patch)
treedc656544bd9110c7a00019f4571473ddf99b2d08
parent5dc79f98713180c98d3451614b6a8f770a033ad8 (diff)
Plug mem leak in error path; ok florian@ who also spotted the rad case
-rw-r--r--sbin/unwind/parse.y4
-rw-r--r--usr.sbin/rad/parse.y4
2 files changed, 6 insertions, 2 deletions
diff --git a/sbin/unwind/parse.y b/sbin/unwind/parse.y
index 9c1a48bd3de..1c02f76c7ad 100644
--- a/sbin/unwind/parse.y
+++ b/sbin/unwind/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.9 2019/10/18 06:00:46 otto Exp $ */
+/* $OpenBSD: parse.y,v 1.10 2019/10/18 06:03:25 otto Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -162,6 +162,8 @@ varset : STRING '=' string {
if (isspace((unsigned char)*s)) {
yyerror("macro name cannot contain "
"whitespace");
+ free($1);
+ free($3);
YYERROR;
}
}
diff --git a/usr.sbin/rad/parse.y b/usr.sbin/rad/parse.y
index 004e5e22f92..bb18c3d9c9c 100644
--- a/usr.sbin/rad/parse.y
+++ b/usr.sbin/rad/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.14 2019/05/10 01:29:31 guenther Exp $ */
+/* $OpenBSD: parse.y,v 1.15 2019/10/18 06:03:25 otto Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -174,6 +174,8 @@ varset : STRING '=' string {
if (isspace((unsigned char)*s)) {
yyerror("macro name cannot contain "
"whitespace");
+ free($1);
+ free($3);
YYERROR;
}
}