Freeswitch的console端在加载时存在一处必现的内存泄漏,如下
==440== 72 bytes in 1 blocks are definitely lost in loss record 348 of 457
==440== at 0x4C29F73: malloc (vg_replace_malloc.c:309)
==440== by 0x67E717D: wcsdup (in /usr/lib64/libc-2.17.so)
==440== by 0x76DEA3F: el_set (in /usr/lib64/libedit.so.0.0.42)
==440== by 0x51A0604: switch_console_loop (switch_console.c:1153)
==440== by 0x51D7981: switch_core_runtime_loop (switch_core.c:1202)
==440== by 0x40479F: main (switch.c:1208)
泄漏代码处在,这里使用的是libedit,注册热键
查看一下libedit源码
发现这里代码注释里都写着会有leak;再看一下释放的地方
确实也只是置NULL而已,没有free
所以该处泄漏是因为libedit所导致。
但是也是在启动时加载泄漏一些字符串字节,总体上还能接受。