summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2014-12-07 16:05:09 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2014-12-07 16:05:09 +0000
commit4af52b55e5411924cb679481a6bde11367bb22a9 (patch)
tree082effeac225783a3afc289df56ff1912e73482f /usr.sbin/httpd
parent0d0884c3b9232e59227f3de45a774fb394e61a54 (diff)
Avoid NULL deref in error case; found with llvm.
OK reyk
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/config.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/httpd/config.c b/usr.sbin/httpd/config.c
index bf5269ba9b5..a902004344a 100644
--- a/usr.sbin/httpd/config.c
+++ b/usr.sbin/httpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.23 2014/11/22 00:24:22 tedu Exp $ */
+/* $OpenBSD: config.c,v 1.24 2014/12/07 16:05:08 florian Exp $ */
/*
* Copyright (c) 2011 - 2014 Reyk Floeter <reyk@openbsd.org>
@@ -400,8 +400,10 @@ config_getserver(struct httpd *env, struct imsg *imsg)
return (0);
fail:
- free(srv->srv_conf.ssl_cert);
- free(srv->srv_conf.ssl_key);
+ if (srv != NULL) {
+ free(srv->srv_conf.ssl_cert);
+ free(srv->srv_conf.ssl_key);
+ }
free(srv);
return (-1);