summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2017-10-19 06:49:46 +0000
committerjsg <jsg@openbsd.org>2017-10-19 06:49:46 +0000
commit9d58ffee19a5b43d8ef370439623a532fbb09fde (patch)
tree753d0c96128a858353df6aee97f85d075f22b40d
parentPass the SIOCG80211ALLCHANS and SIOCG80211STATS ioctls to our net80211 (diff)
downloadwireguard-openbsd-9d58ffee19a5b43d8ef370439623a532fbb09fde.tar.xz
wireguard-openbsd-9d58ffee19a5b43d8ef370439623a532fbb09fde.zip
fix a use after free and a memory leak in error paths
ok deraadt@ florian@
-rw-r--r--usr.sbin/acme-client/parse.y5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/acme-client/parse.y b/usr.sbin/acme-client/parse.y
index d40c8e90ba2..13e71039d9f 100644
--- a/usr.sbin/acme-client/parse.y
+++ b/usr.sbin/acme-client/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.17 2017/03/23 12:59:32 florian Exp $ */
+/* $OpenBSD: parse.y,v 1.18 2017/10/19 06:49:46 jsg Exp $ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -225,8 +225,8 @@ domain : DOMAIN STRING {
if ((s = strdup($2)) == NULL)
err(EXIT_FAILURE, "strdup");
if (!domain_valid(s)) {
- free(s);
yyerror("%s: bad domain syntax", s);
+ free(s);
YYERROR;
}
if ((domain = conf_new_domain(conf, s)) == NULL) {
@@ -336,6 +336,7 @@ domainoptsl : ALTERNATIVE NAMES '{' altname_l '}'
err(EXIT_FAILURE, "strdup");
if (authority_find(conf, s) == NULL) {
yyerror("use: unknown authority");
+ free(s);
YYERROR;
}
domain->auth = s;