diff options
author | Hisham <hisham@gobolinux.org> | 2016-08-24 18:12:35 -0300 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-08-24 18:12:35 -0300 |
commit | cceab15b9dbdc2f0914c8d479cefa429d1c0daaf (patch) | |
tree | b604451eaf0a6d161649c654e9f4b2214c23f693 /StringUtils.c | |
parent | bd5d37f297fed2a42acbbd730e2af5ad45af6afa (diff) |
free(NULL) is a valid no-op, so let's make String_freeArray(NULL) valid too.
Diffstat (limited to 'StringUtils.c')
-rw-r--r-- | StringUtils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/StringUtils.c b/StringUtils.c index 9547a07e..0578cdea 100644 --- a/StringUtils.c +++ b/StringUtils.c @@ -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]); } |