Ticket #2058: fixed memory leaks in _vfs_get_cwd() function.