Possible fix a null pointer dereference bug in io.c