Skip to content

Commit c16c69c

Browse files
committed
Fix double free error in fbdev backend
Removed the free(old) call from the _twin_queue_delete function, consolidating memory deallocation into the _twin_queue_review_order function. This change improves memory management and enhances the maintainability of the code. The fix was verified using GDB to confirm that old is properly freed during the execution of free(q) in the _twin_queue_review_order function. Additionally, AddressSanitizer was used to confirm the absence of memory leaks and double free issues.
1 parent 2cc4b56 commit c16c69c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/queue.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ void _twin_queue_delete(twin_queue_t **head, twin_queue_t *old)
5454
{
5555
_twin_queue_remove(head, old);
5656
old->deleted = true;
57-
if (!old->walking)
58-
free(old);
5957
}
6058

6159
twin_queue_t *_twin_queue_set_order(twin_queue_t **head)

0 commit comments

Comments
 (0)