mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 14:29:39 +00:00
lfree was not updated in mem_realloc!
This commit is contained in:
parent
afad35a8ac
commit
9ef005454a
@ -424,6 +424,9 @@ HISTORY
|
||||
|
||||
++ Bug fixes:
|
||||
|
||||
2007-10-08 Simon Goldschmidt
|
||||
* mem.c: lfree was not updated in mem_realloc!
|
||||
|
||||
2007-10-07 Simon Goldschmidt
|
||||
* udp.c, inet.c, inet.h: Fixed UDPLite SENDING: Checksum was always generated
|
||||
too short and also was generated wrong if checksum coverage != tot_len.
|
||||
|
@ -341,6 +341,9 @@ mem_realloc(void *rmem, mem_size_t newsize)
|
||||
next = mem2->next;
|
||||
/* create new struct mem which is moved directly after the shrinked mem */
|
||||
ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
|
||||
if (lfree == mem2) {
|
||||
lfree = (struct mem *)&ram[ptr2];
|
||||
}
|
||||
mem2 = (struct mem *)&ram[ptr2];
|
||||
mem2->used = 0;
|
||||
/* restore the next pointer */
|
||||
@ -366,6 +369,9 @@ mem_realloc(void *rmem, mem_size_t newsize)
|
||||
* the 2 regions would be combined, resulting in more free memory */
|
||||
ptr2 = ptr + SIZEOF_STRUCT_MEM + newsize;
|
||||
mem2 = (struct mem *)&ram[ptr2];
|
||||
if (mem2 < lfree) {
|
||||
lfree = mem2;
|
||||
}
|
||||
mem2->used = 0;
|
||||
mem2->next = mem->next;
|
||||
mem2->prev = ptr;
|
||||
|
Loading…
Reference in New Issue
Block a user