Fixed a memory allocation bug for the path variable.