util: Fix segfault in the func ConstructLocalPath