From: Rich Felker Date: Sat, 3 Aug 2013 01:20:33 +0000 (-0400) Subject: make tdestroy allow null function pointer if no destructor is needed X-Git-Tag: v0.9.13~90 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d3a98ff69a41d96d0a73f1d5b686f73a03a2f9df;p=oweals%2Fmusl.git make tdestroy allow null function pointer if no destructor is needed this change is to align with a change in the glibc interface. --- diff --git a/src/search/tdestroy.c b/src/search/tdestroy.c index 6f430bda..5f9e197d 100644 --- a/src/search/tdestroy.c +++ b/src/search/tdestroy.c @@ -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); }