Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double free error #79

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/twin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,6 @@ void _twin_path_sfinish(twin_path_t *path);
typedef struct _twin_queue {
struct _twin_queue *next;
struct _twin_queue *order;
bool walking;
bool deleted;
} twin_queue_t;

Expand Down
5 changes: 0 additions & 5 deletions src/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ void _twin_queue_insert(twin_queue_t **head,
break;
new->next = *prev;
new->order = 0;
new->walking = false;
new->deleted = false;
*prev = new;
}
Expand Down Expand Up @@ -54,8 +53,6 @@ void _twin_queue_delete(twin_queue_t **head, twin_queue_t *old)
{
_twin_queue_remove(head, old);
old->deleted = true;
if (!old->walking)
free(old);
}

twin_queue_t *_twin_queue_set_order(twin_queue_t **head)
Expand All @@ -64,7 +61,6 @@ twin_queue_t *_twin_queue_set_order(twin_queue_t **head)

for (twin_queue_t *q = first; q; q = q->next) {
q->order = q->next;
q->walking = true;
}
return first;
}
Expand All @@ -76,7 +72,6 @@ void _twin_queue_review_order(twin_queue_t *first)
for (q = first; q; q = o) {
o = q->order;
q->order = 0;
q->walking = false;
if (q->deleted)
free(q);
}
Expand Down