You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
拉取/合并请求描述:(PR description)
问题描述
发现个内存泄漏的地方,解决特殊情况下出现的内存泄漏问题,将申请的内存直接进行初始化,而不是在其他条件下执行成功才初始化,执行失败不进行初始化直接释放内存,这段内存只有正确初始化之后才会被释放掉,否则不会被释放掉
修改方案
将申请的内存直接进行初始化,而不是在其他条件下执行成功才初始化,执行失败不进行初始化直接释放内存
测试验证
BSP:rt-thread\bsp\hc32\ev_hc32f4a0_lqfp176
.config:rt-thread默认配置UDP数量为4
action:开启超过4个的udp连接,此时sal_socket会执行失败,失败原因是UDP数量不够,失败的时候不会执行dfs_vnode_init初始化函数对申请的vnode内存进行初始化,直接就释放该内存,但是释放该内存的依据是ref_count--为0,未进行初始化的时候,ret_count是个随机值,进行自减极大概率不会变成0,导致这块内存实际上并没有被释放掉
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up