aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasper2013-05-23 13:03:52 +0000
committerWynn Wolf Arbor2020-05-24 12:33:55 +0200
commit22fbaacffcf3159edd6877b1a1afcc4040070d3b (patch)
tree7704c0cc869d116ae4306e89a97e0fbf0e56949c
parent95abc4e350e418fec9b5fa73551e4f9bf07808d5 (diff)
downloadslowcgi-22fbaacffcf3159edd6877b1a1afcc4040070d3b.tar.gz
Fix pasto where 'c' instead of 'clients' is checked for NULL and add missing free for the fcgi_response.
ok florian@
-rw-r--r--slowcgi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/slowcgi.c b/slowcgi.c
index 2bdc72b..029f64a 100644
--- a/slowcgi.c
+++ b/slowcgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slowcgi.c,v 1.1 2013/05/23 12:03:24 florian Exp $ */
+/* $OpenBSD: slowcgi.c,v 1.2 2013/05/23 13:03:52 jasper Exp $ */
/*
* Copyright (c) 2013 David Gwynne <dlg@openbsd.org>
* Copyright (c) 2013 Florian Obser <florian@openbsd.org>
@@ -376,7 +376,7 @@ slowcgi_accept(int fd, short events, void *arg)
return;
}
clients = calloc(1, sizeof(*clients));
- if (c == NULL) {
+ if (clients == NULL) {
lwarn("cannot calloc clients");
close(s);
free(c);
@@ -815,6 +815,7 @@ script_in(int fd, struct event *ev, struct client *c, uint8_t type)
switch (errno) {
case EINTR:
case EAGAIN:
+ free(resp);
return;
default:
n = 0; /* fake empty FCGI_STD{OUT,ERR} response */