Avoid double-free if malloc fails in inputPush It's the caller's responsibility to free the input stream if this function fails.