[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Bug in mem_realloc (patch included)
From: |
address@hidden |
Subject: |
Re: [lwip-users] Bug in mem_realloc (patch included) |
Date: |
Mon, 08 Oct 2007 20:38:44 +0200 |
User-agent: |
Thunderbird 2.0.0.6 (Windows/20070728) |
Hi PH,
Just spent a couple of hours figuring out what the heck my system was
doing. Turned out there's a bug in the mem_realloc(). The bug appears at
least in the CVS head version and seems to be have been introduced when
the plug_holes() call was removed from me_realloc().
Problem appers if you realloc the last used mem block in the heap.
Todays code just creates a new struct mem for the empty unused block
that represents the unused heap. The problem is that the lfree variable
that should point to the last unused block (in this case the block we
move) isn't updated. As a result lfree points to an invalid mem block.
Thanks for the bug report. The 'else' below in mem_realloc was missing
an lfree update also.
That file has been hard work for some people already ;-)
Should I submit a bug report too?
It's the normal way to do with a bug report like yours, yes (to prevent
it from being lost on the mailing list).
But since I already fixed it in CVS HEAD, there's no need to do that now.
Thanks again,
Simon