https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81235
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- realloc is not under GCC control. That is GCC does not provide the libc where realloc is implemented. Please report this to where your libc is from. I suspect either cygwin or mingw. But saying that can you double check to make sure you are not writing past the memory allocation because if you are then realloc could possibility to return NULL.