Actions
Bug #1872
closeda bug in chunkqueue_remove_empty_last_chunk
ASK QUESTIONS IN Forums:
Description
In file "chunk.c", the aim of function "chunkqueue_remove_empty_last_chunk" is to remove the last chunk, but it doesn't work correctly.
686 void chunkqueue_remove_empty_last_chunk(chunkqueue *cq) { 687 chunk *c; 688 if (!cq->last) return; 689 if (!cq->first) return; 690 691 if (cq->first == cq->last) { 692 c = cq->first; 693 694 if (c->type != MEM_CHUNK) return; 695 if (c->mem->used == 0) { 696 chunk_free(c); 697 cq->first = cq->last = NULL; 698 } 699 return; 700 } 701 702 for (c = cq->first; c->next; c = c->next) { 703 if (c->type != MEM_CHUNK) continue; 704 if (c->mem->used != 0) continue; 705 706 if (c->next == cq->last) { 707 cq->last = c; 708 709 chunk_free(c->next); 710 c->next = NULL; 711 712 return; 713 } 714 } 715 }
line 703~704 should be :
703 if (c->next->type != MEM_CHUNK) continue; 704 if (c->next->mem->used != 0) continue;
Files
Updated by liming about 15 years ago
I found this bug has been fixed, please close it
Updated by icy about 15 years ago
- Status changed from Patch Pending to Fixed
- Missing in 1.5.x set to No
Thanks :)
Actions
Also available in: Atom