when we free it, we know it's not NULL
This commit is contained in:
parent
834d87173a
commit
82ea09e146
1 changed files with 5 additions and 7 deletions
12
src/token.c
12
src/token.c
|
@ -21,15 +21,13 @@ str_array * str_array_create(int cap) {
|
|||
}
|
||||
|
||||
void str_array_free(str_array *l) {
|
||||
if (l) {
|
||||
for ( int i = 0; i < l->len ; i++ ) {
|
||||
char * t = l->tokens[ i ];
|
||||
if (t) {
|
||||
zfree(t);
|
||||
}
|
||||
for ( int i = 0; i < l->len ; i++ ) {
|
||||
char * t = l->tokens[ i ];
|
||||
if (t) {
|
||||
zfree(t);
|
||||
}
|
||||
zfree(l);
|
||||
}
|
||||
zfree(l);
|
||||
}
|
||||
|
||||
bool str_array_is_full(str_array * l) {
|
||||
|
|
Loading…
Reference in a new issue