* input/stream.c: checks memory allocation, patch by Michael Gao completed by myself