Certainly realloc should never be called (except maybe by the gcd code that Stephen put in). It could be that I just blew the calculation I make of what the maximum space needed is, but it would be pretty strange that it only showed up now. I'll take a look at what is going on. Is the test program ever doing a gcd?