mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
free(NULL) is a valid no-op, so let's make String_freeArray(NULL) valid too.
This commit is contained in:
parent
bd5d37f297
commit
cceab15b9d
@ -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]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user