Skip to content

Commit d2492f5

Browse files
committed
Merge pull request #169 from acv/leak_httpd
Prevent possible leaks
2 parents 1366520 + ae581b3 commit d2492f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/gateway.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,9 @@ main_loop(void)
442442
* values that are not -1, 0 or 1. */
443443
if (webserver->lastError == -1) {
444444
/* Interrupted system call */
445-
continue; /* restart loop */
445+
if (NULL != r) {
446+
httpdEndRequest(r);
447+
}
446448
} else if (webserver->lastError < -1) {
447449
/*
448450
* FIXME
@@ -474,6 +476,9 @@ main_loop(void)
474476
/* webserver->lastError should be 2 */
475477
/* XXX We failed an ACL.... No handling because
476478
* we don't set any... */
479+
if (NULL != r) {
480+
httpdEndRequest(r);
481+
}
477482
}
478483
}
479484

0 commit comments

Comments
 (0)