Line | Branch | Exec | Source |
---|---|---|---|
1 | /* | ||
2 | ** EPITECH PROJECT, 2024 | ||
3 | ** my_free_array | ||
4 | ** File description: | ||
5 | ** Free an array (array) | ||
6 | */ | ||
7 | /** | ||
8 | * @file my_free_array.c | ||
9 | * @brief The file containing the my_free_array function | ||
10 | * @author Nicolas TORO | ||
11 | */ | ||
12 | |||
13 | #include "my.h" | ||
14 | |||
15 | 12647 | void my_free_array(void **array) | |
16 | { | ||
17 |
2/2✓ Branch 0 taken 1576 times.
✓ Branch 1 taken 11071 times.
|
12647 | if (array == NULL) |
18 | 1576 | return; | |
19 |
2/2✓ Branch 0 taken 24793 times.
✓ Branch 1 taken 11071 times.
|
35864 | for (int i = 0; array[i] != NULL; i++) |
20 | 24793 | FREE(array[i]); | |
21 | 11071 | FREE(array); | |
22 | } | ||
23 |