Fix uninitialized path variable

This function needs to be revisited to solve the 4k problem, however
there is a much more critical bug here, where path is uninitialized
before use.