From 12916e283fdeb87b84f09379c056614c6196615a Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Tue, 6 Dec 2022 23:00:12 -0800 Subject: MJIT: Use xfree for units now that we use ZALLOC_N for allocating units --- mjit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mjit.c b/mjit.c index 04337f6529..2352c8d34e 100644 --- a/mjit.c +++ b/mjit.c @@ -359,7 +359,7 @@ free_unit(struct rb_mjit_unit *unit) if (unit->handle && dlclose(unit->handle)) { // handle is NULL if it's in queue mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror()); } - free(unit); + xfree(unit); } // Start a critical section. Use message `msg` to print debug info at `level`. @@ -757,7 +757,7 @@ load_compact_funcs_from_so(struct rb_mjit_unit *unit, char *c_file, char *so_fil void *handle = dlopen(so_file, RTLD_NOW); if (handle == NULL) { mjit_warning("failure in loading code from compacted '%s': %s", so_file, dlerror()); - free(unit); + xfree(unit); return; } unit->handle = handle; @@ -1122,7 +1122,7 @@ free_list(struct rb_mjit_unit_list *list, bool close_handle_p) if (unit->handle && dlclose(unit->handle)) { mjit_warning("failed to close handle for u%d: %s", unit->id, dlerror()); } - free(unit); + xfree(unit); } else { free_unit(unit); -- cgit v1.2.3