mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-13 04:34:35 +03:00
free(NULL) is a valid no-op, so let's make String_freeArray(NULL) valid too.
This commit is contained in:
@ -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]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user