diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-10-19 06:49:47 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2017-10-19 06:49:47 +0000 |
commit | ed5a0b934aa8036416e66838b9eed1013ae5127f (patch) | |
tree | d08aaee329f29503e80a221b51c93b202c391894 /usr.sbin/acme-client | |
parent | 998f783964e190ffc787e3c34f8308d2ebb91ea9 (diff) |
fix a use after free and a memory leak in error paths
ok deraadt@ florian@
Diffstat (limited to 'usr.sbin/acme-client')
-rw-r--r-- | usr.sbin/acme-client/parse.y | 5 |
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; |