summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-02-05 10:46:18 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-02-05 10:46:18 +0000
commitdee472075c23b52135919ef7ff3ab1c7ea93ffe8 (patch)
tree4f58fe629a3069f3213fcef036c29c0647ca3bf6 /usr.sbin
parent033b85bb05655027db9dce79e7bf5359a157e7a4 (diff)
Add missing error case to free allocated server_config on failure.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/httpd/config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c
index 28fbecb5ecb..2cf17e64675 100644
--- a/usr.sbin/httpd/config.c
+++ b/usr.sbin/httpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.32 2015/01/21 22:21:05 reyk Exp $ */
+/* $OpenBSD: config.c,v 1.33 2015/02/05 10:46:17 reyk Exp $ */
/*
* Copyright (c) 2011 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -264,7 +264,7 @@ config_getserver_config(struct httpd *env, struct server *srv,
parent = &srv->srv_conf;
if (config_getserver_auth(env, srv_conf) != 0)
- return (-1);
+ goto fail;
if (srv_conf->flags & SRVFLAG_LOCATION) {
/* Inherit configuration from the parent */
@@ -358,6 +358,11 @@ config_getserver_config(struct httpd *env, struct server *srv,
TAILQ_INSERT_TAIL(&srv->srv_hosts, srv_conf, entry);
return (0);
+
+ fail:
+ serverconfig_free(srv_conf);
+ free(srv_conf);
+ return (-1);
}
int