https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108448
--- Comment #15 from Andrew Pinski <pinskia at gcc dot gnu.org> --- void* y_realloc(void* ptr, y_usize size) __attribute__((malloc)); Yes that should NOT be malloc. I wonder if removing malloc from y_realloc fixes the issue. NOTE realloc is not marked as malloc. See the whole thread starting at https://gcc.gnu.org/pipermail/gcc/2004-January/118629.html it is a long thread. And IIRC the conclusion in the end was malloc attribute was wrong on realloc and then removed from glibc's definition.