fixed memory leak with write_root_inode