when we free it, we know it's not NULL

This commit is contained in:
c9s 2014-05-21 18:22:11 +08:00
parent 834d87173a
commit 82ea09e146

View file

@ -21,15 +21,13 @@ str_array * str_array_create(int cap) {
} }
void str_array_free(str_array *l) { void str_array_free(str_array *l) {
if (l) { for ( int i = 0; i < l->len ; i++ ) {
for ( int i = 0; i < l->len ; i++ ) { char * t = l->tokens[ i ];
char * t = l->tokens[ i ]; if (t) {
if (t) { zfree(t);
zfree(t);
}
} }
zfree(l);
} }
zfree(l);
} }
bool str_array_is_full(str_array * l) { bool str_array_is_full(str_array * l) {