9 Star 0 Fork 8

src-openEuler / hostname

 / 详情

hostname内存泄漏问题

已完成
任务
创建于  
2024-05-20 14:43

hostname代码的localhost()函数里分配了128字节的内存,如下图所示:
输入图片说明
show_name()函数调用localhost()函数来打印用户名之后直接退出了,并没有去释放内存,如下图所示:
输入图片说明
为了防止内存泄漏,应该在退出程序前把内存给释放掉,如下图所示:
输入图片说明

修复pr:
https://gitee.com/src-openeuler/hostname/pulls

评论 (1)

binlingyu 创建了任务

Hi binlingyu, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Networking, and any of the maintainers: @luzhihao , @Apricity , @robertxw , @孙苏皖 , @renmingshuai , @jinag12

openeuler-ci-bot 添加了
 
sig/Networking
标签
binlingyu 修改了描述
binlingyu 通过src-openeuler/hostname Pull Request !7任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
5329419 openeuler ci bot 1632792936
1
https://gitee.com/src-openeuler/hostname.git
git@gitee.com:src-openeuler/hostname.git
src-openeuler
hostname
hostname

搜索帮助

344bd9b3 5694891 D2dac590 5694891