Allowing an array parameter to be NULL.

This fixes Savannah bug #46420.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5457 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg
2015-11-30 16:44:44 +00:00
parent 66e21416af
commit 42ac5368e1
3 changed files with 5 additions and 3 deletions

View File

@@ -2553,7 +2553,8 @@ int diralphasort(const void *va, const void *vb)
* elements. */
void free_chararray(char **array, size_t len)
{
assert(array != NULL);
if (array == NULL)
return;
for (; len > 0; len--)
free(array[len - 1]);