修复 xy_file_to_str 的内存泄露

This commit is contained in:
Mikachu2333
2025-10-06 01:53:27 +08:00
parent 5771a308a6
commit b2a844b676

View File

@@ -745,7 +745,7 @@ xy_file_read (const char *path)
buf[read_bytes] = '\0';
char *formatted_str = xy_str_gsub (buf, "\r\n", "\n");
formatted_str = xy_str_gsub (formatted_str, "\r", "\n");
xy_str_swap (&formatted_str, xy_str_gsub (formatted_str, "\r", "\n"));
free (buf);