make tdestroy allow null function pointer if no destructor is needed
authorRich Felker <dalias@aerifal.cx>
Sat, 3 Aug 2013 01:20:33 +0000 (21:20 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 3 Aug 2013 01:20:33 +0000 (21:20 -0400)
this change is to align with a change in the glibc interface.

src/search/tdestroy.c

index 6f430bda182c948950b24a3886932df7f1321cb1..5f9e197dcd1ea57869a0aa74f3c57d010ec163c6 100644 (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);
 }