lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #25705] Memory Leak in HTTPD.C


From: Edward Harris
Subject: [lwip-devel] [bug #25705] Memory Leak in HTTPD.C
Date: Wed, 25 Feb 2009 15:18:21 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6 (.NET CLR 3.5.30729)

URL:
  <http://savannah.nongnu.org/bugs/?25705>

                 Summary: Memory Leak in HTTPD.C
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: eharris
            Submitted on: Wed 25 Feb 2009 15:18:19 GMT
                Category: Contrib
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

The http_poll callback function does not free the http_state structure when
aborts the current tcp.

Add a "mem_free(hs);" after line 254. Function now reads thus:

static err_t
http_poll(void *arg, struct tcp_pcb *pcb)
{
  struct http_state *hs;

  hs = arg;
  
  /*  printf("Polll\n");*/
  if (hs == NULL) {
    /*    printf("Null, close\n");*/
    tcp_abort(pcb);
    return ERR_ABRT;
  } else {
    ++hs->retries;
    if (hs->retries == 4) {
      mem_free(hs);
      tcp_abort(pcb);
      return ERR_ABRT;
    }
    send_data(pcb, hs);
  }

  return ERR_OK;
}





    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?25705>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]