the war against malloc continues, with more RAII