make tdestroy allow null function pointer if no destructor is needed

this change is to align with a change in the glibc interface.
This commit is contained in:
Rich Felker 2013-08-02 21:20:33 -04:00
parent 2d2da648f6
commit d3a98ff69a
1 changed files with 1 additions and 1 deletions

View File

@ -16,6 +16,6 @@ void tdestroy(void *root, void (*freekey)(void *))
return;
tdestroy(r->left, freekey);
tdestroy(r->right, freekey);
freekey(r->key);
if (freekey) freekey(r->key);
free(r);
}