Commit 841ac41
committed
fix: fix use-after-free bug in config reparse
Fixed a use-after-free bug where the file pointer was being deleted
before being reassigned, which could lead to dangling pointer issues.
Replaced manual deletion with std::unique_ptr to ensure proper ownership
transfer and automatic cleanup.
Influence:
1. Test config file reloading functionality
2. Verify no crashes occur during config refresh operations
3. Test multiple consecutive config reparse operations
4. Verify memory management is handled correctly
fix: 修复配置重新解析中的释放后使用错误
修复了一个释放后使用的错误,其中文件指针在重新分配之前被删除,可能导致悬
空指针问题。使用 std::unique_ptr 替换手动删除操作,确保正确的所有权转移
和自动清理。
Influence:
1. 测试配置文件重新加载功能
2. 验证配置刷新操作期间不会发生崩溃
3. 测试多次连续的配置重新解析操作
4. 验证内存管理是否正确处理1 parent 644f4ed commit 841ac41
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
0 commit comments