| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2024 | ||
| 3 | ** my_free_ptr | ||
| 4 | ** File description: | ||
| 5 | ** Free a pointer (ptr) and set it to NULL | ||
| 6 | */ | ||
| 7 | /** | ||
| 8 | * @file my_free_ptr.c | ||
| 9 | * @brief The file containing the my_free_ptr function | ||
| 10 | * @author Nicolas TORO | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "my.h" | ||
| 14 | |||
| 15 | 861629 | void *my_free_ptr(void *ptr) | |
| 16 | { | ||
| 17 |
3/4✓ Branch 0 taken 860329 times.
✓ Branch 1 taken 1300 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 860329 times.
|
861629 | if (ptr == NULL || !ptr) |
| 18 | 1300 | return NULL; | |
| 19 | 860329 | free(ptr); | |
| 20 | 860329 | ptr = NULL; | |
| 21 | 860329 | return NULL; | |
| 22 | } | ||
| 23 |