The file handler owns the filename string, so it needs to free it. Therefore, it should not be a pointer-to-const.