getpwnam_r memory leak

心不动则不痛 提交于 2019-12-05 14:44:25

The memory isn't really allocated for getpwnam specifically. Instead, it represents the configuration of /etc/nsswitch.conf. AFAICT, the only way to have libc release this memory is through calling __libc_freeres:

extern void __libc_freeres (void);

This is supposed to release all memory that the C library holds onto (not just the memory NSS holds onto).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!