Won't this leak bucket->data_ptr if LZ4 is enabled? `realloc()` on line 337 would do it.