From d3a98ff69a41d96d0a73f1d5b686f73a03a2f9df Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Fri, 2 Aug 2013 21:20:33 -0400 Subject: [PATCH] make tdestroy allow null function pointer if no destructor is needed this change is to align with a change in the glibc interface. --- src/search/tdestroy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.25.1