tasklwIP - A Lightweight TCP/IP stack - Tasks: task #9192, mem_free of dhcp->options_in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #9192: mem_free of dhcp->options_in and dhcp->msg_in

Submitter:  Rikke Ottesen <ro03>
Submitted:  Mon 16 Mar 2009 08:09:56 AM UTC
   
 
Category:  DHCP Should Start On:  Mon 16 Mar 2009 12:00:00 AM UTC
Should be Finished on:  Mon 16 Mar 2009 12:00:00 AM UTC Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  0%
Open/Closed:  Closed Planned Release:  1.3.1
Effort:  0.05

Thu 16 Apr 2009 06:44:33 AM UTC, comment #3: 

Thanks! Next time I'll be more specific :)

Cheers
Rikke

Rikke Ottesen <ro03>
Wed 15 Apr 2009 07:54:28 PM UTC, comment #2: 

Yep, a bug. The 2 buffers aren't freed until the next dhcp datagram is received.

The original submission could be a bit more readable, but after looking through the code I got the point: at the end of dhcp_recv(), dhcp_free_reply() must be called.

Fixed.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 03 Apr 2009 10:59:02 AM UTC, comment #1: 

I'd class this as a bug, rather than a task.

Kieran Mansley <kieranm>
Group Member
Mon 16 Mar 2009 08:09:56 AM UTC, original submission:  

Function:
static err_t dhcp_unfold_reply(struct dhcp *dhcp);

This function does not free the:

  • dhcp->options_in = mem_malloc(dhcp->options_in_len);


  • dhcp->msg_in = mem_malloc(sizeof(struct dhcp_msg) - DHCP_OPTIONS_LEN);




Resolution:
I have freed the memory in this function together with the pbuf *p:


static void dhcp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)

in the bottom of the function I have freed it with dhcp_free_reply(dhcp);

Rikke Ottesen <ro03>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by ro03 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-04-15 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2009-04-03 kieranm Planned ReleaseNone 1.3.1

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code