[TS-1648] Segmentation fault in dir_clear_range()