fix leaks and a crash in LUKS format