Commit cceab15b authored by Hisham's avatar Hisham
Browse files

free(NULL) is a valid no-op, so let's make String_freeArray(NULL) valid too.

parent bd5d37f2
......@@ -93,6 +93,9 @@ char** String_split(const char* s, char sep, int* n) {
}
void String_freeArray(char** s) {
if (!s) {
return;
}
for (int i = 0; s[i] != NULL; i++) {
free(s[i]);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment