Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
** EPITECH PROJECT, 2024 |
3 |
|
|
** zappy |
4 |
|
|
** File description: |
5 |
|
|
** destroy.c |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
#include "server.h" |
9 |
|
|
|
10 |
|
1 |
void destroy_flags(flags_t *flags) |
11 |
|
|
{ |
12 |
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
1 |
if (flags == NULL) |
13 |
|
|
return; |
14 |
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
1 |
if (flags->names == NULL) |
15 |
|
|
return; |
16 |
2/2
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
|
3 |
for (size_t i = 0; flags->names[i] != NULL; i++) { |
17 |
|
2 |
secure_free((void **)&flags->names[i]); |
18 |
|
|
} |
19 |
|
1 |
free(flags->names); |
20 |
|
|
} |
21 |
|
|
|
22 |
|
✗ |
void destroy_server(server_t server) |
23 |
|
|
{ |
24 |
|
✗ |
destroy_flags(&server.proprieties); |
25 |
|
✗ |
destroy_clients(&server.clients); |
26 |
|
✗ |
destroy_teams(&server.teams); |
27 |
|
✗ |
} |
28 |
|
|
|