On Thu, Feb 02 2023, Eric Wong wrote: > + kh_foreach_value(island_marks, bitmap, { > + if (--bitmap->refcount == 0) Style nit: if (!--x) rather than if (--x == 0) ? > + free(bitmap); > + }); > + kh_destroy_oid_map(island_marks); > + island_marks = (void *)1; /* crash on unintended future use */ This seems counter-productive. If you just leave it free'd then various analysis tools will spot a use-after-free earlier, won't they?