From 344d28f961951fc31d404fa8f57cfb1f2e947ddb Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 2 Aug 2025 11:57:07 +0900 Subject: [PATCH] khash.h (kh_destroy): both kh_destroy_data and mrb_free works with NULL --- include/mruby/khash.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/mruby/khash.h b/include/mruby/khash.h index c2322f71d..342c10c33 100644 --- a/include/mruby/khash.h +++ b/include/mruby/khash.h @@ -187,10 +187,8 @@ static const uint8_t __m_either[] = {0x03, 0x0c, 0x30, 0xc0}; } \ void kh_destroy_##name(mrb_state *mrb, kh_##name##_t *h) \ { \ - if (h) { \ - kh_destroy_data_##name(mrb, h); \ - mrb_free(mrb, h); \ - } \ + kh_destroy_data_##name(mrb, h); \ + mrb_free(mrb, h); \ } \ void kh_clear_##name(mrb_state *mrb, kh_##name##_t *h) \ { \