-/* $OpenBSD: server.c,v 1.62 2015/04/11 14:52:49 jsing Exp $ */
+/* $OpenBSD: server.c,v 1.63 2015/04/23 16:59:28 florian Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
if ((clt = calloc(1, sizeof(*clt))) == NULL)
goto err;
+ /* Pre-allocate log buffer */
+ clt->clt_log = evbuffer_new();
+ if (clt->clt_log == NULL)
+ goto err;
+
clt->clt_s = s;
clt->clt_fd = -1;
clt->clt_toread = TOREAD_UNLIMITED;
return;
}
- /* Pre-allocate log buffer */
- clt->clt_log = evbuffer_new();
- if (clt->clt_log == NULL) {
- server_close(clt, "failed to allocate log buffer");
- return;
- }
-
if (srv->srv_conf.flags & SRVFLAG_TLS) {
event_again(&clt->clt_ev, clt->clt_s, EV_TIMEOUT|EV_READ,
server_accept_tls, &clt->clt_tv_start,