Are you ever calling realloc? The IRIS does not seem to implement it correctly, when reallocing to the a larger size it seems to just return the original pointer rather than a pointer to a new larger block. I have had to give up on realloc on the IRIS.