fix: strdup a la con
This commit is contained in:
parent
f721e6db72
commit
b663655d53
2 changed files with 7 additions and 16 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#include "ast_word.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -43,6 +42,8 @@ void ast_free_word(struct ast_word *ast_node)
|
|||
if (ast_node == NULL)
|
||||
return;
|
||||
|
||||
free(ast_node->word);
|
||||
if (ast_node->word != NULL)
|
||||
free(ast_node->word);
|
||||
|
||||
free(ast_node);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue