feature/txtr-s3-memory-leak

Fix some memory leaks, please review. Not a complete audit.