GCC Code Coverage Report


Directory: ./
File: lib/my/my_free_ptr.c
Date: 2024-06-05 00:36:48
Exec Total Coverage
Lines: 6 6 100.0%
Functions: 1 1 100.0%
Branches: 3 4 75.0%

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 759676 void *my_free_ptr(void *ptr)
16 {
17
3/4
✓ Branch 0 taken 758406 times.
✓ Branch 1 taken 1270 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 758406 times.
759676 if (ptr == NULL || !ptr)
18 1270 return NULL;
19 758406 free(ptr);
20 758406 ptr = NULL;
21 758406 return NULL;
22 }
23