Open
Conversation
|
Hi @Mikachu2333 ❤️ 感谢你的贡献!我们将在最少半小时,最多5天内阅读此 PR 并回复你 |
There was a problem hiding this comment.
Pull request overview
本 PR 聚焦于 lib/xy.h 中的内存管理问题修复,针对字符串处理、日志拼接、命令执行与路径工具函数,补齐释放与失败分支处理,从而减少潜在/实际的内存泄漏风险。
Changes:
- 修复/完善若干函数的内存释放路径(如日志着色字符串、
popen失败分支、循环内重复分配等)。 - 增强部分分配失败时的处理(如
xy_str_gsub增加malloc失败返回、xy_run_get_stdout增加realloc失败处理等)。 - 修正
xy_parent_dir在无分隔符路径场景下的泄漏与返回值处理。
You can also share your feedback on Copilot code review. Take the survey.
ccmywish
requested changes
Mar 17, 2026
Contributor
ccmywish
left a comment
There was a problem hiding this comment.
我建议 _xy_log() 和 _xy_log_brkt() 先不要改,因为这样 free() 的频率太高了。
这两个函数(像这种懒得解决的)正是可以用 mempool 去管控的地方。
Contributor
用的时机不对,不应该在 |
Open
Collaborator
Author
说句实话,我其实都完全不想动这地方的,以当前的内存空间大小,漏这一点完全可理解…… |
Collaborator
Author
|
晚上改 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题描述
方案与实现