mixed memory leak in get_full_dirname()