In the IO_init function, when I thought I was assigning to the field of the IO object pointer, I was actually "assigning" to the alloca pointer to that pointer. Later when I tried to read from the IO object field the data wasn't there.