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); }