use malloc for NULL_STREAM object to avoid double free