Change sanitize_path() function to not malloc a copy since it only shrinks