Fixed bug #25705 (memory leak in httpserver_raw when aborting connection)

This commit is contained in:
goldsimon 2009-03-01 17:50:06 +00:00
parent 15d75600bb
commit 0f06910f66

View File

@ -106,13 +106,15 @@ http_poll(void *arg, struct tcp_pcb *pcb)
hs = arg;
/* printf("Polll\n");*/
if (hs == NULL) {
if ((hs == NULL) && (pcb->state == ESTABLISHED)) {
/* printf("Null, close\n");*/
tcp_abort(pcb);
return ERR_ABRT;
} else {
} else if (hs != NULL) {
++hs->retries;
if (hs->retries == 4) {
tcp_arg(pcb, NULL);
mem_free(hs);
tcp_abort(pcb);
return ERR_ABRT;
}