ODIN: fixes a potential memory leak