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.
Merge pull request #2066 from worr/bug/uninitialized-memory

Fix uninitialized path variable