mirror of
https://gitee.com/RubyMetric/chsrc.git
synced 2025-12-25 20:52:49 +00:00
修复 xy_normalize_path 内存泄漏问题
This commit is contained in:
parent
41783b8531
commit
948d55185f
5
lib/xy.h
5
lib/xy.h
|
|
@ -1250,7 +1250,10 @@ xy_normalize_path (const char *path)
|
|||
|
||||
if (xy_str_start_with (new, "~"))
|
||||
{
|
||||
xy_str_swap (&new, xy_2strcat (xy_os_home, xy_str_delete_prefix (new, "~")));
|
||||
char *tmp = xy_str_delete_prefix (new, "~");
|
||||
char *joined = xy_2strcat (xy_os_home, tmp);
|
||||
free (tmp);
|
||||
xy_str_swap (&new, joined);
|
||||
}
|
||||
|
||||
if (xy.on_windows)
|
||||
|
|
|
|||
Loading…
Reference in New Issue