maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
clean_utils.c File Reference
#include "tokens.h"
Include dependency graph for clean_utils.c:

Go to the source code of this file.

Functions

void free_all_tokes (t_token *tokens)
 
void free_all_tokens (t_token *tokens)
 

Function Documentation

◆ free_all_tokens()

void free_all_tokens ( t_token tokens)

Definition at line 17 of file clean_utils.c.

18{
19 t_token *temp;
20
21 while (tokens)
22 {
23 temp = tokens;
24 tokens = tokens->next;
25 if (temp)
26 {
27 if (temp->data)
28 {
29 free(temp->data);
30 temp->data = NULL;
31 }
32 }
33 free(temp);
34 temp = NULL;
35 }
36}
struct s_token * next
Definition tokens.h:45
char * data
Definition tokens.h:44

References s_token::data, and s_token::next.

Referenced by loop_cleanup().

Here is the caller graph for this function:

◆ free_all_tokes()

void free_all_tokes ( t_token tokens)