Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2023 | ||
3 | ** delete_list | ||
4 | ** File description: | ||
5 | ** Deletes a linked list | ||
6 | */ | ||
7 | |||
8 | #include "mylist.h" | ||
9 | |||
10 | 6 | void my_delete_list(linked_list_t **begin) | |
11 | { | ||
12 | 6 | linked_list_t *tmp = *begin; | |
13 | 6 | linked_list_t *next = NULL; | |
14 | |||
15 |
2/2✓ Branch 0 taken 5 times.
✓ Branch 1 taken 6 times.
|
11 | while (tmp != NULL) { |
16 | 5 | next = tmp->next; | |
17 |
2/4✓ Branch 0 taken 5 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✗ Branch 3 not taken.
|
5 | if (tmp->data != NULL && tmp->type != UNKNOWN) |
18 | 5 | FREE(tmp->data); | |
19 | 5 | FREE(tmp); | |
20 | 5 | tmp = next; | |
21 | } | ||
22 | 6 | *begin = NULL; | |
23 | 6 | } | |
24 |